Skip to content

Commit

Permalink
chore(ARCO-283): check if key exists when counting records
Browse files Browse the repository at this point in the history
  • Loading branch information
pawellewandowski98 committed Nov 19, 2024
1 parent be2cd5c commit d490e9f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/cache/in_memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ func (s *MemoryStore) GetAllForHashAndDelete(hash string) (map[string][]byte, er
func (s *MemoryStore) CountElementsForHash(hash string) (int64, error) {
hashMap, err := s.GetAllForHash(hash)
if err != nil {
if errors.Is(err, ErrCacheNotFound) {
return 0, nil
}
return 0, err
}

Expand Down

0 comments on commit d490e9f

Please sign in to comment.