jetcache icon indicating copy to clipboard operation
jetcache copied to clipboard

different method cache key, second method will follow the first method TTL

Open Ikki-Dai opened this issue 3 years ago • 0 comments

version : com.alicp.jetcache: jetcache-starter-redis-lettuce: 2.6.0

case

while have 2 method as below:

    @Cached(area = "area", name = ":test:", key = "'def'", expire = 2, timeUnit = TimeUnit.HOURS)
    public List test1(Instant startTime, Instant endTime) {
        System.out.println("############# execute 1");
        return new ArrayList();
    }

    @Cached(area = "area", name = ":test:", key = "'abc'", expire = 1, timeUnit = TimeUnit.HOURS)
    public List test2(Instant startTime, Instant endTime) {
        System.out.println("############# execute 2");
        return new ArrayList();
    }

occurs

  1. while execute method test1 and then test2, both key TTL are 7200
  2. while execute method test2 and then test1, both key TTL are 3600

it only effects last : split namespace

Ikki-Dai avatar Jul 15 '21 08:07 Ikki-Dai