Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove resource offers in DealNegotiating[0] state on disconnect #475

Merged
merged 4 commits into from
Jan 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: Rename ID to resourceProviderID
  • Loading branch information
bgins committed Jan 6, 2025
commit 2df9fad7aa3d7da670dd6d7ad0497deee4827fa7
8 changes: 4 additions & 4 deletions pkg/solver/controller.go
Original file line number Diff line number Diff line change
@@ -405,10 +405,10 @@ func (controller *SolverController) addResourceOffer(resourceOffer data.Resource
}

// Remove resource offers in an unmatched DealNegotiating[0] state
func (controller *SolverController) removeUnmatchedResourceOffers(ID string) error {
controller.log.Info("remove resource offer", ID)
func (controller *SolverController) removeUnmatchedResourceOffers(resourceProviderID string) error {
controller.log.Info("remove resource offer", resourceProviderID)
resourceOffers, err := controller.store.GetResourceOffers(store.GetResourceOffersQuery{
ResourceProvider: ID,
ResourceProvider: resourceProviderID,
})
if err != nil {
return err
@@ -419,7 +419,7 @@ func (controller *SolverController) removeUnmatchedResourceOffers(ID string) err
err = controller.store.RemoveResourceOffer(offer.ID)
if err != nil {
controller.log.Error("remove resource offer failed",
fmt.Errorf("resource provider: %s, offer ID: %s, error: %s", ID, offer.ID, err))
fmt.Errorf("resource provider: %s, offer ID: %s, error: %s", resourceProviderID, offer.ID, err))
}
}
}
Loading