diff --git a/src/main/java/app/updates/BaseUpdater.java b/src/main/java/app/updates/BaseUpdater.java index eeb425a..7860490 100644 --- a/src/main/java/app/updates/BaseUpdater.java +++ b/src/main/java/app/updates/BaseUpdater.java @@ -2,6 +2,7 @@ package app.updates; import java.util.concurrent.Callable; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executors; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; @@ -9,10 +10,10 @@ import java.util.function.Supplier; public abstract class BaseUpdater { public void CreateTaskUpdater(Supplier function, int timeout) { System.out.printf("Create task: %s, update after %d sec\n", function.toString(), timeout / 1000); - CompletableFuture.supplyAsync(() -> { + Executors.newFixedThreadPool(1).submit(() -> { while (true) { try { - System.out.printf("Call: %s\n", function.toString()); + //System.out.printf("Call: %s\n", function.toString()); function.get(); } catch (Exception err) { err.printStackTrace();