diff --git a/redisson/src/main/java/org/redisson/command/CommandAsyncService.java b/redisson/src/main/java/org/redisson/command/CommandAsyncService.java index 5b577ff75..a3d2ef88d 100644 --- a/redisson/src/main/java/org/redisson/command/CommandAsyncService.java +++ b/redisson/src/main/java/org/redisson/command/CommandAsyncService.java @@ -41,6 +41,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; +import java.time.Duration; import java.util.*; import java.util.Map.Entry; import java.util.concurrent.*; @@ -951,7 +952,7 @@ public class CommandAsyncService implements CommandAsyncExecutor { protected CommandBatchService createCommandBatchService(int availableSlaves) { BatchOptions options = BatchOptions.defaults() - .syncSlaves(availableSlaves, getServiceManager().getCfg().getSlavesSyncTimeout(), TimeUnit.MILLISECONDS); + .sync(availableSlaves, Duration.ofMillis(getServiceManager().getCfg().getSlavesSyncTimeout())); return new CommandBatchService(this, options); }