[chore]: Bump codeberg.org/gruf/go-cache/v3 from 3.4.1 to 3.4.3 (#2022)

This commit is contained in:
dependabot[bot]
2023-07-24 10:20:11 +00:00
committed by GitHub
parent 8b71567f9e
commit c9f3539b5a
4 changed files with 17 additions and 9 deletions

View File

@ -228,11 +228,15 @@ func (c *Cache[Value]) Load(lookup string, load func() (Value, error), keyParts
var evict func()
// Acquire cache lock.
// Lock cache.
c.cache.Lock()
defer func() {
// Unlock cache.
c.cache.Unlock()
if evict != nil {
// Call evict.
evict()
}
}()
@ -266,21 +270,25 @@ func (c *Cache[Value]) Store(value Value, store func() error) error {
var evict func()
// Acquire cache lock.
// Lock cache.
c.cache.Lock()
defer func() {
// Unlock cache.
c.cache.Unlock()
if evict != nil {
// Call evict.
evict()
}
// Call invalidate.
c.invalid(value)
}()
// Store result in cache.
evict = c.store(result)
// Call invalidate.
c.invalid(value)
return nil
}

2
vendor/modules.txt vendored
View File

@ -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.1
# codeberg.org/gruf/go-cache/v3 v3.4.3
## explicit; go 1.19
codeberg.org/gruf/go-cache/v3
codeberg.org/gruf/go-cache/v3/result