mirror of
https://github.com/harness/drone.git
synced 2025-05-04 01:49:29 +08:00
[maint] fix cache decoder (#1150)
This commit is contained in:
parent
2f5e79cee0
commit
c57ea55b82
6
cache/redis_cache.go
vendored
6
cache/redis_cache.go
vendored
@ -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 {
|
||||||
|
value, decErr := c.codec.Decode(raw)
|
||||||
|
if decErr == nil {
|
||||||
c.countHit++
|
c.countHit++
|
||||||
return c.codec.Decode(raw)
|
return value, nil
|
||||||
}
|
}
|
||||||
if !errors.Is(err, redis.Nil) {
|
} else if !errors.Is(err, redis.Nil) {
|
||||||
return nothing, err
|
return nothing, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user