alibaba / alibaba/jetcache

jetcache-redis-lettuce 不支持 expireAfterAccess特性,缓存访问后 expire时间刷新,需要怎么才能实现?

Open
#655 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.6k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

在使用jetcache-redis-lettuce时,当设置 expireAfterAccess 参数后,会报异常:
`
Caused by: com.alicp.jetcache.CacheConfigException: expireAfterAccess is not supported
at com.alicp.jetcache.redis.lettuce.RedisLettuceCache.(RedisLettuceCache.java:51)
at com.alicp.jetcache.redis.lettuce.RedisLettuceCacheBuilder.lambda$new$0(RedisLettuceCacheBuilder.java:21)
at com.alicp.jetcache.AbstractCacheBuilder.buildCache(AbstractCacheBuilder.java:43)
at cn.trustway.nix.boot.cache.configuration.NixCacheAutoConfiguration.globalRemoteCache(NixCacheAutoConfiguration.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 20 common frames omitted
`
请教一下,如何让缓存访问后,expire失效时间,能够刷新expire时间?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with RedisLettuceCache.java, where the stack trace reports expireAfterAccess as unsupported, and trace construction through RedisLettuceCacheBuilder.java. Determine the cache behavior and configuration needed for access-based expiration, then verify that configuring expireAfterAccess no longer fails and that access refreshes the expiration time.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, redis
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.