-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: expiration time did not respect environment variable #915 #916
base: master
Are you sure you want to change the base?
Conversation
@@ -169,15 +165,20 @@ protected CacheResult do_PUT_ALL(Map<? extends K, ? extends V> map, long expireA | |||
return new CacheResult(future); | |||
} | |||
|
|||
private CacheResult PUT_caches(int lastIndex, K key, V value, long expire, TimeUnit timeUnit) { | |||
private CacheResult PUT_caches(int lastIndex, K key, V value, long expire, TimeUnit timeUnit, boolean isForce) { | |||
CompletableFuture<ResultData> future = CompletableFuture.completedFuture(null); | |||
for (int i = 0; i < lastIndex; i++) { | |||
Cache cache = caches[i]; | |||
CacheResult r; | |||
if (timeUnit == null) { | |||
r = cache.PUT(key, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在这里取min (expire,cache的默认expire)比较好,就不用加isForce参数了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那这样的话,如果用户主动 PUT 一个大于配置时间的过期时间,就不行了。这个 PR 我想到一些边界,还没测试
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你说的这个问题存在,怎么又改回去了呢
这个还改吗? |
Resolves #915
TODO:
@Cache(type=BOTH)
and not setting localExpire