From 28f94d2013b9631e44abd99c204f4659cf02f120 Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Wed, 3 Apr 2024 12:19:25 +0300 Subject: [PATCH] refactoring --- .../java/org/redisson/command/RedisQueuedBatchExecutor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/redisson/src/main/java/org/redisson/command/RedisQueuedBatchExecutor.java b/redisson/src/main/java/org/redisson/command/RedisQueuedBatchExecutor.java index b84adc027..7cc76c81e 100644 --- a/redisson/src/main/java/org/redisson/command/RedisQueuedBatchExecutor.java +++ b/redisson/src/main/java/org/redisson/command/RedisQueuedBatchExecutor.java @@ -98,6 +98,11 @@ public class RedisQueuedBatchExecutor extends BaseRedisBatchExecutor protected void releaseConnection(CompletableFuture attemptPromise, CompletableFuture connectionFuture) { if (RedisCommands.EXEC.getName().equals(command.getName()) || RedisCommands.DISCARD.getName().equals(command.getName())) { + if (attempt < attempts + && attemptPromise.isCompletedExceptionally()) { + return; + } + super.releaseConnection(attemptPromise, connectionFuture); } }