From 729db37cdc8e05e013a7dda194e16b907797218c Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Fri, 18 Oct 2024 12:03:07 +0700 Subject: [PATCH] fix the skidded code on HBot doing absolutely nothing because i did shutdownNow() instead of shutdown() --- src/main/java/me/chayapak1/chomens_bot/Main.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/me/chayapak1/chomens_bot/Main.java b/src/main/java/me/chayapak1/chomens_bot/Main.java index d46c9ee..bd57f49 100644 --- a/src/main/java/me/chayapak1/chomens_bot/Main.java +++ b/src/main/java/me/chayapak1/chomens_bot/Main.java @@ -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++) {