Skip to content

Commit 46b7eec

Browse files
committed
Get rid of double executor in retrying
Closes #382
1 parent b78b06f commit 46b7eec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/io/tarantool/driver/core/RetryingTarantoolClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,12 @@ private <S> CompletableFuture<S> wrapOperation(Supplier<CompletableFuture<S>> op
440440

441441
private TarantoolSpaceOperations<T, R> getTarantoolSpaceOperationsRetrying(
442442
Supplier<TarantoolSpaceOperations<T, R>> spaceSupplier) {
443+
CompletableFuture<TarantoolSpaceOperations<T, R>> wrapperForSync = new CompletableFuture<>();
443444
try {
444-
return wrapOperation(() -> CompletableFuture.supplyAsync(spaceSupplier, executor)).get();
445+
return wrapOperation(() -> {
446+
wrapperForSync.complete(spaceSupplier.get());
447+
return wrapperForSync;
448+
}).get();
445449
} catch (InterruptedException e) {
446450
throw new CompletionException(e);
447451
} catch (ExecutionException e) {

0 commit comments

Comments
 (0)