diff options
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/codeberg.org/gruf/go-cache/v3/ttl/ttl.go | 11 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/vendor/codeberg.org/gruf/go-cache/v3/ttl/ttl.go b/vendor/codeberg.org/gruf/go-cache/v3/ttl/ttl.go index 623a19910..af108e336 100644 --- a/vendor/codeberg.org/gruf/go-cache/v3/ttl/ttl.go +++ b/vendor/codeberg.org/gruf/go-cache/v3/ttl/ttl.go @@ -479,23 +479,23 @@ func (c *Cache[K, V]) InvalidateAll(keys ...K) (ok bool) { kvs = make([]kv[K, V], 0, len(keys)) c.locked(func() { - for _, key := range keys { + for x := range keys { var item *Entry[K, V] // Check for item in cache - item, ok = c.Cache.Get(key) + item, ok = c.Cache.Get(keys[x]) if !ok { - return + continue } // Append this old value to slice kvs = append(kvs, kv[K, V]{ - K: key, + K: keys[x], V: item.Value, }) // Remove from cache map - _ = c.Cache.Delete(key) + _ = c.Cache.Delete(keys[x]) // Free entry c.free(item) @@ -553,6 +553,7 @@ func (c *Cache[K, V]) Cap() (l int) { return } +// locked performs given function within mutex lock (NOTE: UNLOCK IS NOT DEFERRED). func (c *Cache[K, V]) locked(fn func()) { c.Lock() fn() diff --git a/vendor/modules.txt b/vendor/modules.txt index 64a310838..006cc3e5d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -13,7 +13,7 @@ codeberg.org/gruf/go-bytesize # codeberg.org/gruf/go-byteutil v1.1.2 ## explicit; go 1.16 codeberg.org/gruf/go-byteutil -# codeberg.org/gruf/go-cache/v3 v3.4.3 +# codeberg.org/gruf/go-cache/v3 v3.4.4 ## explicit; go 1.19 codeberg.org/gruf/go-cache/v3 codeberg.org/gruf/go-cache/v3/result |