fix 修复 兼容redis5.0出现的问题

2.X
疯狂的狮子Li 9 months ago
parent f3f0464ea1
commit ef5aacc6e1

@ -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…
Cancel
Save