fix 修复 兼容redis5.0出现的问题
This commit is contained in:
parent
d403688a0c
commit
18e3b424d6
@ -107,7 +107,11 @@ public class RedisUtils {
|
||||
bucket.setAndKeepTTL(value);
|
||||
} catch (Exception e) {
|
||||
long timeToLive = bucket.remainTimeToLive();
|
||||
setCacheObject(key, value, Duration.ofMillis(timeToLive));
|
||||
if (timeToLive == -1) {
|
||||
setCacheObject(key, value);
|
||||
} else {
|
||||
setCacheObject(key, value, Duration.ofMillis(timeToLive));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bucket.set(value);
|
||||
|
Loading…
x
Reference in New Issue
Block a user