deps: Upgrade github.com/bep/lazycache v0.6.0 => v0.7.0

This commit is contained in:
Bjørn Erik Pedersen
2024-10-27 10:31:59 +01:00
parent e10915f80a
commit 62567d3820
4 changed files with 60 additions and 15 deletions

View File

@@ -430,12 +430,25 @@ func (p *Partition[K, V]) doGetOrCreateWitTimeout(key K, duration time.Duration,
errch := make(chan error, 1)
go func() {
v, _, err := p.c.GetOrCreate(key, create)
if err != nil {
errch <- err
return
}
resultch <- v
var (
v V
err error
)
defer func() {
if r := recover(); r != nil {
if rerr, ok := r.(error); ok {
err = rerr
} else {
err = fmt.Errorf("panic: %v", r)
}
}
if err != nil {
errch <- err
} else {
resultch <- v
}
}()
v, _, err = p.c.GetOrCreate(key, create)
}()
select {