Skip to content

Commit

Permalink
KVStore: Factor out fetching of a typed value
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjat committed May 5, 2023
1 parent 2be609e commit f8d29c7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions storage/oasis/nodeapi/file/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ func GetFromCacheOrCall[Value any](cache KVStore, volatile bool, key CacheKey, v

// If the value is cached, return it.
isCached, err := cache.Has(key)
if err != nil {
return nil, err
}
if isCached {
if err == nil && isCached {
raw, err2 := cache.Get(key)
if err2 != nil {
cache.logger.Warn(fmt.Sprintf("failed to fetch key %s from cache: %v", key.Pretty(), err2))
Expand Down

0 comments on commit f8d29c7

Please sign in to comment.