Fix: ttl 为 -1 时续命错误

This commit is contained in:
CareyWong 2020-06-02 15:19:50 +08:00
parent 56c91c28b3
commit f037aa023a

View File

@ -242,6 +242,8 @@ func renew(shortKey string) {
// 续命 // 续命
ttl, _ := redis.Int(redisClient.Do("ttl", shortKey)) ttl, _ := redis.Int(redisClient.Do("ttl", shortKey))
_, _ = redisClient.Do("expire", shortKey, ttl+defaultRenewal*secondsPerDay) if ttl != -1 {
_, _ = redisClient.Do("expire", shortKey, ttl+defaultRenewal*secondsPerDay)
}
} }
} }