refactoring

pull/4113/head
Nikita Koksharov 3 years ago
parent 412dc67176
commit d649843210

@ -205,13 +205,13 @@ public class RedissonScript implements RScript {
RFuture<R> f = commandExecutor.evalReadAsync(key, codec, cmd, shaDigest, keys, encode(Arrays.asList(values), codec).toArray());
CompletableFuture<R> result = new CompletableFuture<>();
f.whenComplete((r, e) -> {
if (e != null) {
if (e.getMessage().startsWith("ERR unknown command")) {
commandExecutor.setEvalShaROSupported(false);
RFuture<R> 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<R> s = evalShaAsync(key, mode, shaDigest, returnType, keys, values);
commandExecutor.transfer(s.toCompletableFuture(), result);
return;
}
commandExecutor.transfer(f.toCompletableFuture(), result);
});
return new CompletableFutureWrapper<>(result);
}

Loading…
Cancel
Save