Skip to content

设置有效过期时长

Latest
Compare
Choose a tag to compare
@fmyxyz fmyxyz released this 24 Nov 03:23

Full Changelog: v1.1.0...v1.1.1

func (c *Client) expireKeyTTl(ctx context.Context, key string, expiration time.Duration) error {
	if expiration > 0 {
		return c.Expire(ctx, key, expiration).Err()
	}
	return nil
}