Fix: ttl 为 -1 时续命错误
This commit is contained in:
parent
56c91c28b3
commit
f037aa023a
4
main.go
4
main.go
@ -242,6 +242,8 @@ func renew(shortKey string) {
|
||||
|
||||
// 续命
|
||||
ttl, _ := redis.Int(redisClient.Do("ttl", shortKey))
|
||||
_, _ = redisClient.Do("expire", shortKey, ttl+defaultRenewal*secondsPerDay)
|
||||
if ttl != -1 {
|
||||
_, _ = redisClient.Do("expire", shortKey, ttl+defaultRenewal*secondsPerDay)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user