diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java index 9dd999c..b6bac31 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java @@ -40,7 +40,7 @@ public class Bot { @Getter private boolean loggedIn = false; - @Getter private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(100); + @Getter private final ScheduledExecutorService executor = Main.executor; @Getter @Setter private ConsolePlugin console; @Getter @Setter private LoggerPlugin logger; // in ConsolePlugin diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/Main.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/Main.java index c5dc36c..bc912ec 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/Main.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/Main.java @@ -11,10 +11,14 @@ import javax.security.auth.login.LoginException; import java.io.*; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; public class Main { public static final List bots = new ArrayList<>(); + public static final ScheduledExecutorService executor = Executors.newScheduledThreadPool(50); + public static void main(String[] args) throws IOException { final File file = new File("config.yml"); final Constructor constructor = new Constructor(Configuration.class);