Skip to content
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

有什么方法可以获取某个key还有多久过期吗 #928

Open
LAIguapi opened this issue Sep 21, 2024 · 3 comments
Open

有什么方法可以获取某个key还有多久过期吗 #928

LAIguapi opened this issue Sep 21, 2024 · 3 comments

Comments

@LAIguapi
Copy link

1,如标题
2,我在创建cache实例的时候设置了过期时间,那我后续某个key希望设置为永不过期,应该怎么设置,
put(key,value,-1,timeUnit)吗?
如果有已经解答的issue或者文档中有提到,劳烦大佬指一下路,找了一下似乎没看到

@areyouok
Copy link
Collaborator

不是-1,你put的时候设置一个数值很大的过期时间就行了,会覆盖默认的超时时间

@LAIguapi
Copy link
Author

不是-1,你put的时候设置一个数值很大的过期时间就行了,会覆盖默认的超时时间

emmm,那看key多久过期呢,现在是不是没有啥办法能看key多久过期

@areyouok
Copy link
Collaborator

没有public的办法,除非你自己改造

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

No branches or pull requests

2 participants