refactoring

pull/5315/head
Nikita Koksharov 1 year ago
parent c802abb446
commit 4e7724eddf

@ -84,10 +84,7 @@ public class PingConnectionHandler extends ChannelInboundHandlerAdapter {
Throwable cause = cause(future); Throwable cause = cause(future);
if (!(cause instanceof RedisLoadingException if (!(cause instanceof RedisRetryException)) {
|| cause instanceof RedisTryAgainException
|| cause instanceof RedisClusterDownException
|| cause instanceof RedisBusyException)) {
if (!future.isCancelled()) { if (!future.isCancelled()) {
log.error("Unable to send PING command over channel: {}", ctx.channel(), cause); log.error("Unable to send PING command over channel: {}", ctx.channel(), cause);
} }

@ -161,10 +161,10 @@ public class RedisCommonBatchExecutor extends RedisExecutor<Object, Void> {
protected void handleResult(CompletableFuture<Void> attemptPromise, CompletableFuture<RedisConnection> connectionFuture) throws ReflectiveOperationException { protected void handleResult(CompletableFuture<Void> attemptPromise, CompletableFuture<RedisConnection> connectionFuture) throws ReflectiveOperationException {
if (attemptPromise.isDone() && !attemptPromise.isCompletedExceptionally()) { if (attemptPromise.isDone() && !attemptPromise.isCompletedExceptionally()) {
if (slots.decrementAndGet() == 0) { if (slots.decrementAndGet() == 0) {
mainPromise.complete(null); handleSuccess(mainPromise, connectionFuture, null);
} }
} else { } else {
mainPromise.completeExceptionally(cause(attemptPromise)); handleError(connectionFuture, cause(attemptPromise));
} }
} }

Loading…
Cancel
Save