chore: fix warnings (#3989)
This commit is contained in:
@@ -128,8 +128,8 @@ func (c *Cache) Take(key string, fetch func() (any, error)) (any, error) {
|
||||
|
||||
var fresh bool
|
||||
val, err := c.barrier.Do(key, func() (any, error) {
|
||||
// because O(1) on map search in memory, and fetch is an IO query
|
||||
// so we do double check, cache might be taken by another call
|
||||
// because O(1) on map search in memory, and fetch is an IO query,
|
||||
// so we do double-check, cache might be taken by another call
|
||||
if val, ok := c.doGet(key); ok {
|
||||
return val, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user