small optimization

pull/303/head
Nikita 9 years ago
parent 35c8d49fea
commit 60cccc033b

@ -58,13 +58,14 @@ public class IdleConnectionWatcher {
@Override
public void run() {
long currTime = System.currentTimeMillis();
for (Entry entry : entries) {
if (!validateAmount(entry)) {
continue;
}
for (final RedisConnection c : entry.connections) {
final long timeInPool = System.currentTimeMillis() - c.getLastUsageTime();
final long timeInPool = currTime - c.getLastUsageTime();
if (timeInPool > config.getIdleConnectionTimeout()
&& validateAmount(entry) && entry.connections.remove(c)) {
ChannelFuture future = c.closeAsync();

Loading…
Cancel
Save