Skip to content

Commit

Permalink
Merge pull request #49 from kumparan/hotfix/fix-get-multiple-or-lock
Browse files Browse the repository at this point in the history
hotfix: fix get multi on disable caching
  • Loading branch information
zipzap11 authored Apr 10, 2023
2 parents 9e9a1fa + 19b8acb commit 0a0e55e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ func (k *keeper) GetOrSet(key string, fn GetterFn, opts ...func(Item)) (res []by
// TODO: refactor this when you are bored
func (k *keeper) GetMultipleOrLock(keys []string) (cachedItems []any, mutexes []*redsync.Mutex, err error) {
if k.disableCaching {
for range keys {
cachedItems = append(cachedItems, nil)
}
return
}

Expand Down Expand Up @@ -1007,6 +1010,9 @@ func (k *keeper) GetHashMemberOrLock(identifier string, key string) (cachedItem
// TODO: refactor this when you are bored
func (k *keeper) GetMultiHashMembersOrLock(identifiers []string, keys []string) (cachedItems []any, mutexes []*redsync.Mutex, err error) {
if k.disableCaching {
for range keys {
cachedItems = append(cachedItems, nil)
}
return
}

Expand Down

0 comments on commit 0a0e55e

Please sign in to comment.