Skip to content

Commit

Permalink
chores: caching lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Nov 10, 2024
1 parent 0bc85b4 commit 6d2b2a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ func CacheSimplifiedVaults(cachingStore *cache.Cache, expire time.Duration, hand
//Json was already sent
return
}
cachingStore.Set(c.Request.URL.String(), result, expire)
logs.Info(`Cache miss with`, len(result), `vaults`)
if len(result) > 0 {
cachingStore.Set(c.Request.URL.String(), result, expire)
logs.Info(`Cache miss with`, len(result), `vaults`)
}
c.JSON(http.StatusOK, result)
}
}
Expand Down

0 comments on commit 6d2b2a1

Please sign in to comment.