mirror of https://github.com/harness/drone.git
[maint] fix cache decoder (#1150)
parent
2f5e79cee0
commit
c57ea55b82
|
@ -77,10 +77,12 @@ func (c *Redis[K, V]) Get(ctx context.Context, key K) (V, error) {
|
||||||
|
|
||||||
raw, err := c.client.Get(ctx, strKey).Result()
|
raw, err := c.client.Get(ctx, strKey).Result()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
c.countHit++
|
value, decErr := c.codec.Decode(raw)
|
||||||
return c.codec.Decode(raw)
|
if decErr == nil {
|
||||||
}
|
c.countHit++
|
||||||
if !errors.Is(err, redis.Nil) {
|
return value, nil
|
||||||
|
}
|
||||||
|
} else if !errors.Is(err, redis.Nil) {
|
||||||
return nothing, err
|
return nothing, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue