Skip to content

Commit

Permalink
feat: Add RemoveDeal store method
Browse files Browse the repository at this point in the history
  • Loading branch information
bgins committed Dec 4, 2024
1 parent 4bf3f67 commit bbe7734
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/solver/store/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,7 @@ func (store *SolverStoreDatabase) RemoveResourceOffer(id string) error {
}
return nil
}

func (store *SolverStoreDatabase) RemoveDeal(id string) error {
return nil
}
7 changes: 7 additions & 0 deletions pkg/solver/store/memory/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,5 +380,12 @@ func (s *SolverStoreMemory) RemoveResourceOffer(id string) error {
return nil
}

func (s *SolverStoreMemory) RemoveDeal(id string) error {
s.mutex.Lock()
defer s.mutex.Unlock()
delete(s.dealMap, id)
return nil
}

// Compile-time interface check:
var _ store.SolverStore = (*SolverStoreMemory)(nil)
1 change: 1 addition & 0 deletions pkg/solver/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type SolverStore interface {
UpdateDealTransactionsMediator(id string, data data.DealTransactionsMediator) (*data.DealContainer, error)
RemoveJobOffer(id string) error
RemoveResourceOffer(id string) error
RemoveDeal(id string) error
}

func GetMatchID(resourceOffer string, jobOffer string) string {
Expand Down

0 comments on commit bbe7734

Please sign in to comment.