From 60cccc033b8dbde7ab0093a2cc5485b4dade4239 Mon Sep 17 00:00:00 2001 From: Nikita Date: Tue, 24 Nov 2015 15:09:12 +0300 Subject: [PATCH] small optimization --- .../java/org/redisson/connection/IdleConnectionWatcher.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/redisson/connection/IdleConnectionWatcher.java b/src/main/java/org/redisson/connection/IdleConnectionWatcher.java index e8e690f49..29d537af4 100644 --- a/src/main/java/org/redisson/connection/IdleConnectionWatcher.java +++ b/src/main/java/org/redisson/connection/IdleConnectionWatcher.java @@ -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();