Closed vchau closed 8 years ago
@debop looks like the old expiration thread has been removed, did you have some thoughts on how this could be improved?
old code
protected synchronized void startExpirationThread(final JedisClient redis) {
if (expirationThread != null && expirationThread.isAlive()) {
return;
}
expirationThread = new Thread(new Runnable() {
@Override
public void run() {
while (true) {
try {
Thread.sleep(1000L);
Set<String> regions = regionNames.clone();
for (final String region : regions) {
if (redis != null) {
try {
redis.expire(region);
} catch (Exception ignored) {
log.warn("Error occurred in expiration management thread. but it was ignored", ignored);
}
}
}
} catch (InterruptedException ignored) {
break;
} catch (Exception ignored) {
log.warn("Error occurred in expiration management thread. but it was ignored", ignored);
}
}
}
});
expirationThread.setDaemon(true);
expirationThread.start();
}
First, I'm not good at English^^
You can set expiration time per region name.
Redisson implement this ttl in Lua code itself.
@debop sounds like this issue could be closed as not a bug then if expiration for region is handled by Redisson.
Yes exactly ^^
Hello, Thank you for this great library. I have a question regarding redis configuration.
I'm trying to fine tune my setup and one of the thing which I need to configure is the redis maxmemory eviction policy. I noticed that hibernate-redis/redisson is not setting the ttl value on cache regions in Redis. What is the recommended eviction policy? Right now, I think
allkeys-lru
andallkeys-random
are the only options since those would be the only ones which make sense. I was hoping to usevolatile-ttl
but there is no ttl on any of these redis keys.