Skip to content

Commit

Permalink
hotfix: fix get multi on disable caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Francisco committed Apr 6, 2023
1 parent 9e9a1fa commit 19b8acb
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 19b8acb

Please sign in to comment.