From c2b4dffa9f116d0d1d2ce4d6a36a300681e21257 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 16 Jul 2023 14:33:21 +0700 Subject: [PATCH] rename executors --- .../java/land/chipmunk/chayapak/chomens_bot/Main.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 4b18767..7a2f73c 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/Main.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/Main.java @@ -1,5 +1,6 @@ package land.chipmunk.chayapak.chomens_bot; +import com.google.common.util.concurrent.ThreadFactoryBuilder; import land.chipmunk.chayapak.chomens_bot.plugins.ConsolePlugin; import net.dv8tion.jda.api.JDA; import net.dv8tion.jda.api.JDABuilder; @@ -23,8 +24,14 @@ import java.util.concurrent.TimeUnit; public class Main { public static final List bots = new ArrayList<>(); - public static final ExecutorService executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); - public static final ScheduledExecutorService executor = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors()); + public static final ExecutorService executorService = Executors.newFixedThreadPool( + Runtime.getRuntime().availableProcessors(), + new ThreadFactoryBuilder().setNameFormat("ExecutorService #%d").build() + ); + public static final ScheduledExecutorService executor = Executors.newScheduledThreadPool( + Runtime.getRuntime().availableProcessors(), + new ThreadFactoryBuilder().setNameFormat("ScheduledExecutorService #%d").build() + ); private static Configuration config;