Skip to content

Commit

Permalink
Merge pull request #15 from joelrose/fix/redigo-expiration
Browse files Browse the repository at this point in the history
fix: expire keys set through the redigo library
  • Loading branch information
joelrose authored Mar 15, 2023
2 parents b0a8dd6 + e12d08f commit f55eb58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (a *RedigoAdapter) Set(ctx context.Context, key string, value interface{},
}
defer conn.Close()

_, err = redigo.DoContext(conn, ctx, "SET", key, value)
_, err = redigo.DoContext(conn, ctx, "SET", key, value, "EX", int(expiration.Seconds()))
if err != nil {
return fmt.Errorf("setting value in redis: %v", err)
}
Expand Down

0 comments on commit f55eb58

Please sign in to comment.