Skip to content

Commit

Permalink
feat: Add new RemoveResult store method
Browse files Browse the repository at this point in the history
  • Loading branch information
bgins committed Dec 5, 2024
1 parent bc0644b commit 8b2a423
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 @@ -498,3 +498,7 @@ func (store *SolverStoreDatabase) RemoveDeal(id string) error {
}
return nil
}

func (store *SolverStoreDatabase) RemoveResult(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 @@ -387,5 +387,12 @@ func (s *SolverStoreMemory) RemoveDeal(id string) error {
return nil
}

func (s *SolverStoreMemory) RemoveResult(id string) error {
s.mutex.Lock()
defer s.mutex.Unlock()
delete(s.resultMap, 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 @@ -77,6 +77,7 @@ type SolverStore interface {
RemoveJobOffer(id string) error
RemoveResourceOffer(id string) error
RemoveDeal(id string) error
RemoveResult(id string) error
}

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

0 comments on commit 8b2a423

Please sign in to comment.