rename executors

This commit is contained in:
Chayapak 2023-07-16 14:33:21 +07:00
parent e981d17fff
commit c2b4dffa9f

View file

@ -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<Bot> 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;