Skip to content

Conversation

@Roiocam
Copy link
Contributor

@Roiocam Roiocam commented Aug 22, 2024

Resolves #915

TODO:

  • verify annotation can be overridden by environment variable
  • verify local expiration time wasn't greater than remote when @Cache(type=BOTH) and not setting localExpire

@Roiocam Roiocam changed the title fix: expiration time did not expect environment #915 fix: expiration time did not respect environment #915 Aug 22, 2024
@Roiocam Roiocam changed the title fix: expiration time did not respect environment #915 fix: expiration time did not respect environment variable #915 Aug 22, 2024
@Roiocam Roiocam marked this pull request as draft August 22, 2024 15:29
Cache cache = caches[i];
CacheResult r;
if (timeUnit == null) {
r = cache.PUT(key, value);
Copy link
Collaborator

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参数了

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那这样的话,如果用户主动 PUT 一个大于配置时间的过期时间,就不行了。这个 PR 我想到一些边界,还没测试

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你说的这个问题存在,怎么又改回去了呢

@areyouok
Copy link
Collaborator

这个还改吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

多级缓存下,仅通过环境变量配置本地过期时间无法生效

2 participants