fix: hopefully fix some errors spam when the bot is stopping sometimes
you don't really notice it unless you host the bot on github actions which changes instance every 6 hours
This commit is contained in:
@@ -192,9 +192,7 @@ public class Main {
|
||||
LoggerUtilities.log(stoppingMessage);
|
||||
|
||||
EXECUTOR.shutdown();
|
||||
|
||||
EXECUTOR_SERVICE.shutdown();
|
||||
|
||||
if (database != null) database.stop();
|
||||
|
||||
final ArrayList<Bot> copiedList;
|
||||
|
||||
@@ -186,6 +186,8 @@ public class PlayersDatabasePlugin implements Listener {
|
||||
|
||||
@Override
|
||||
public void disconnected (final DisconnectedEvent event) {
|
||||
if (Main.stopping) return;
|
||||
|
||||
synchronized (bot.players.list) {
|
||||
final List<PlayerEntry> clonedList = new ArrayList<>(bot.players.list);
|
||||
|
||||
|
||||
@@ -74,6 +74,10 @@ public class FileLoggerUtilities {
|
||||
}
|
||||
}
|
||||
|
||||
public static void stop () {
|
||||
executor.shutdown();
|
||||
}
|
||||
|
||||
private static void tick () {
|
||||
if (freezeTime <= System.currentTimeMillis() && spamLevel > 0) {
|
||||
spamLevel--;
|
||||
|
||||
Reference in New Issue
Block a user