-
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
多级缓存下,仅通过环境变量配置本地过期时间无法生效 #915
Comments
buildLocal的时候会生效的 |
LocalCache 这个对象里面的值会生效,但是 MultiLevelCache 的逻辑不会,取的是 MultiLevelCache 里面的过期时间 jetcache/jetcache-core/src/main/java/com/alicp/jetcache/MultiLevelCache.java Lines 64 to 67 in 984aa2a
而这个 MultiLevelCache 过期时间的取值逻辑是最后一个 Cache 的过期时间(也就是远程过期时间): jetcache/jetcache-core/src/main/java/com/alicp/jetcache/MultiLevelCache.java Lines 28 to 31 in 984aa2a
jetcache/jetcache-core/src/main/java/com/alicp/jetcache/SimpleCacheManager.java Lines 123 to 126 in 984aa2a
|
我明白你的意思了,你的意思是useExpireOfSubCache是多余的。 但当时就这么设计的,现在不确定是否应该改。 |
嗯,有点像是,如果 环境变量 -> 应用配置 -> 硬编码 这种优先级了 |
localExpire是18年后来加的,原先有两层的话,就以remote的为准 |
我提了个 PR #916 请您看一下?去掉了 useExpireOfSubCache:
|
我还没细看,但至少有两个问题:
|
ok, 修复了 |
背景
多级缓存下(cacheType = BOTH) 如果不配置注解的
localExpire
,那么通过配置文件指定的本地过期时间不会生效核心代码:
Config 只会从注解里拿
jetcache/jetcache-core/src/main/java/com/alicp/jetcache/SimpleCacheManager.java
Line 122 in 984aa2a
The text was updated successfully, but these errors were encountered: