Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
redis: fix expiration bug (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
ortuman authored May 26, 2022
1 parent 4375abc commit f576f0a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/storage/cached/redis/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ type Config struct {
type Cache struct {
cfg Config
sp servicePool
ttl time.Duration
logger log.Logger
}

Expand Down Expand Up @@ -78,7 +77,7 @@ func (c *Cache) Put(ctx context.Context, ns, key string, val []byte) error {
if err := cl.HSet(ctx, ns, key, val).Err(); err != nil {
return err
}
return cl.Expire(ctx, ns, c.ttl).Err()
return cl.Expire(ctx, ns, c.cfg.TTL).Err()
}

// Del satisfies Cache interface.
Expand Down

0 comments on commit f576f0a

Please sign in to comment.