refactor: inline thread name
This commit is contained in:
@@ -83,8 +83,7 @@ public class Main {
|
||||
|
||||
config = yaml.load(reader);
|
||||
|
||||
final Thread shutdownThread = new Thread(Main::handleShutdown);
|
||||
shutdownThread.setName("ChomeNS Bot Shutdown Thread");
|
||||
final Thread shutdownThread = new Thread(Main::handleShutdown, "ChomeNS Bot Shutdown Thread");
|
||||
Runtime.getRuntime().addShutdownHook(shutdownThread);
|
||||
|
||||
if (!config.backup.enabled) {
|
||||
|
||||
@@ -12,9 +12,10 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
public class DatabasePlugin {
|
||||
public static final ExecutorService executorService = Executors.newFixedThreadPool(
|
||||
1,
|
||||
new ThreadFactoryBuilder().setNameFormat("ExecutorService (database)").build()
|
||||
public static final ExecutorService executorService = Executors.newSingleThreadExecutor(
|
||||
new ThreadFactoryBuilder()
|
||||
.setNameFormat("ExecutorService (database)")
|
||||
.build()
|
||||
);
|
||||
|
||||
public Connection connection;
|
||||
|
||||
@@ -35,7 +35,9 @@ public class FileLoggerUtilities {
|
||||
|
||||
// we want a completely separate executor from the main one
|
||||
public static final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(
|
||||
new ThreadFactoryBuilder().setNameFormat("ScheduledExecutorService (logger)").build()
|
||||
new ThreadFactoryBuilder()
|
||||
.setNameFormat("ScheduledExecutorService (logger)")
|
||||
.build()
|
||||
);
|
||||
|
||||
public static int spamLevel = 0;
|
||||
|
||||
Reference in New Issue
Block a user