mirror of
https://github.com/mailgun/groupcache.git
synced 2024-11-16 14:10:04 +00:00
feat: do not count context cancelation as peer error
This commit is contained in:
parent
ef11a3aea7
commit
f0dbe185e0
@ -386,6 +386,9 @@ func (g *Group) load(ctx context.Context, key string, dest Sink) (value ByteView
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
g.Stats.PeerLoads.Add(1)
|
g.Stats.PeerLoads.Add(1)
|
||||||
return value, nil
|
return value, nil
|
||||||
|
} else if errors.Is(err, context.Canceled) {
|
||||||
|
// do not count context cancellation as a peer error
|
||||||
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if logger != nil {
|
if logger != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user