fix the skidded code on HBot doing absolutely nothing because i did shutdownNow() instead of shutdown()

This commit is contained in:
Chayapak 2024-10-18 12:03:07 +07:00
parent d00543593f
commit 729db37cdc

View file

@ -187,17 +187,17 @@ public class Main {
// most of these are stolen from HBot
public static void stop () {
executor.shutdownNow();
executor.shutdown();
PersistentDataUtilities.stop();
executorService.shutdownNow();
executorService.shutdown();
try {
final boolean executorDone = executor.awaitTermination(5, TimeUnit.SECONDS);
final boolean executorServiceDone = executorService.awaitTermination(5, TimeUnit.SECONDS);
if (executorDone || executorServiceDone) {
if (!executorDone || !executorServiceDone) {
System.out.println("Executors failed to shut down");
}
} catch (InterruptedException e) {
@ -226,7 +226,7 @@ public class Main {
bot.stop();
}
if (jda != null) jda.shutdownNow();
if (jda != null) jda.shutdown();
if (discordEnabled) {
for (int i = 0; i < 150; i++) {