Skip to content

Commit

Permalink
fix: Acquire lock in GetDealsAll
Browse files Browse the repository at this point in the history
  • Loading branch information
bgins committed Nov 18, 2024
1 parent 80a08ad commit cd12d42
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/solver/store/memory/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ func (s *SolverStoreMemory) GetDeals(query store.GetDealsQuery) ([]data.DealCont
}

func (s *SolverStoreMemory) GetDealsAll() ([]data.DealContainer, error) {
s.mutex.RLock()
defer s.mutex.RUnlock()
deals := []data.DealContainer{}
for _, deal := range s.dealMap {
deals = append(deals, *deal)
Expand Down

0 comments on commit cd12d42

Please sign in to comment.