Merge pull request #6244 from Wujiaxuan007/bugfix/fix-connection-usage

fix(ConnectionsHolder): correct usage counting logic
pull/6249/head
Nikita Koksharov 4 months ago committed by GitHub
commit f5a73c578a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -91,7 +91,7 @@ public class ConnectionsHolder<T extends RedisConnection> {
private T pollConnection(RedisCommand<?> command) {
T c = freeConnections.poll();
if (c != null) {
if (c != null && changeUsage) {
c.incUsage();
}
return c;
@ -109,7 +109,9 @@ public class ConnectionsHolder<T extends RedisConnection> {
connection.setLastUsageTime(System.nanoTime());
freeConnections.add(connection);
connection.decUsage();
if (changeUsage) {
connection.decUsage();
}
}
public Queue<T> getAllConnections() {

Loading…
Cancel
Save