mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 13:22:25 -05:00
[chore]: Bump codeberg.org/gruf/go-cache/v3 from 3.4.1 to 3.4.3 (#2022)
This commit is contained in:
parent
8b71567f9e
commit
c9f3539b5a
4 changed files with 17 additions and 9 deletions
18
vendor/codeberg.org/gruf/go-cache/v3/result/cache.go
generated
vendored
18
vendor/codeberg.org/gruf/go-cache/v3/result/cache.go
generated
vendored
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue