Use connection pool optimization only if size less than 10 connections.

pull/3848/head
Nikita Koksharov 3 years ago
parent d5350a70b6
commit e8c6d00791

@ -505,9 +505,12 @@ public class RedisExecutor<V, R> {
connectionType, command, LogHelper.toString(params), source, connection.getRedisClient().getAddr(), connection);
}
writeFuture = connection.send(new CommandData<>(attemptPromise, codec, command, params));
if (connectionManager.getConfig().getMasterConnectionPoolSize() < 10) {
release(connection);
}
}
}
protected void releaseConnection(RPromise<R> attemptPromise, RFuture<RedisConnection> connectionFuture) {
if (!connectionFuture.isSuccess()) {
@ -516,9 +519,13 @@ public class RedisExecutor<V, R> {
RedisConnection connection = connectionFuture.getNow();
connectionManager.getShutdownLatch().release();
if (connectionManager.getConfig().getMasterConnectionPoolSize() < 10) {
if (source.getRedirect() == Redirect.ASK || getClass() != RedisExecutor.class) {
release(connection);
}
} else {
release(connection);
}
if (log.isDebugEnabled()) {
String connectionType = " ";

Loading…
Cancel
Save