refactor: optimize the bot even more!!!

it improved a lot, memory usage is pretty good now, just reducing the amount of threads for each executor and adding some more delay to the filtering stuff
This commit is contained in:
ChomeNS
2025-03-05 15:44:44 +07:00
parent de4e3e8e96
commit 02b9fd4f0b
6 changed files with 18 additions and 10 deletions

View File

@@ -13,8 +13,8 @@ import java.util.concurrent.Executors;
public class DatabasePlugin {
// is it OK to have a completely separate ExecutorService to do the executions?
public static final ExecutorService executorService = Executors.newFixedThreadPool(
Runtime.getRuntime().availableProcessors(),
new ThreadFactoryBuilder().setNameFormat("ExecutorService (database) #%d").build()
1,
new ThreadFactoryBuilder().setNameFormat("ExecutorService (database)").build()
);
public Connection connection;