Open zysaaa opened 2 years ago
Try this:
expiringMap.put("a", "a", 1000, TimeUnit.MILLISECONDS);
expiringMap.setExpiration("a", 20_000, TimeUnit.MILLISECONDS);
Thread.sleep(5000);
System.out.println(expiringMap.get("a")); // output "a"
I think this should at least be documented on the put(K, V, long, TimeUnit)
as it's kind of unexpected behaviour.
Just stumbled across this issue while trying to update an entry during an ExpirationListener
.
Is this expected behavior? Can't I refresh
ttl
of this key?