From d6498432107e320445832d6c433055f77c5b3e6b Mon Sep 17 00:00:00 2001 From: Nikita Koksharov Date: Mon, 7 Feb 2022 15:34:01 +0300 Subject: [PATCH] refactoring --- .../src/main/java/org/redisson/RedissonScript.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/redisson/src/main/java/org/redisson/RedissonScript.java b/redisson/src/main/java/org/redisson/RedissonScript.java index 2691a4f5b..4004e89b8 100644 --- a/redisson/src/main/java/org/redisson/RedissonScript.java +++ b/redisson/src/main/java/org/redisson/RedissonScript.java @@ -205,13 +205,13 @@ public class RedissonScript implements RScript { RFuture f = commandExecutor.evalReadAsync(key, codec, cmd, shaDigest, keys, encode(Arrays.asList(values), codec).toArray()); CompletableFuture result = new CompletableFuture<>(); f.whenComplete((r, e) -> { - if (e != null) { - if (e.getMessage().startsWith("ERR unknown command")) { - commandExecutor.setEvalShaROSupported(false); - RFuture s = evalShaAsync(key, mode, shaDigest, returnType, keys, values); - commandExecutor.transfer(s.toCompletableFuture(), result); - } + if (e != null && e.getMessage().startsWith("ERR unknown command")) { + commandExecutor.setEvalShaROSupported(false); + RFuture s = evalShaAsync(key, mode, shaDigest, returnType, keys, values); + commandExecutor.transfer(s.toCompletableFuture(), result); + return; } + commandExecutor.transfer(f.toCompletableFuture(), result); }); return new CompletableFutureWrapper<>(result); }