SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'Fix discord bot shutdown' (#254) from fixShutdown into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #254
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2021-10-05 12:13:46 +02:00
Commit dc83c2bda1

Datei anzeigen

@ -31,7 +31,6 @@ import de.steamwar.bungeecore.listeners.mods.WorldDownloader;
import de.steamwar.bungeecore.sql.Statement; import de.steamwar.bungeecore.sql.Statement;
import de.steamwar.bungeecore.sql.SteamwarUser; import de.steamwar.bungeecore.sql.SteamwarUser;
import de.steamwar.bungeecore.sql.Team; import de.steamwar.bungeecore.sql.Team;
import net.dv8tion.jda.api.JDA;
import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
@ -168,10 +167,7 @@ public class BungeeCore extends Plugin {
@Override @Override
public void onDisable(){ public void onDisable(){
try { try {
SteamwarDiscordBot.instance().getJda().shutdownNow(); SteamwarDiscordBot.instance().getJda().shutdown();
SteamwarDiscordBot.instance().getJda().awaitStatus(JDA.Status.SHUTDOWN);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (Throwable e) { } catch (Throwable e) {
getLogger().log(Level.SEVERE, "Could not shutdown discord bot", e); getLogger().log(Level.SEVERE, "Could not shutdown discord bot", e);
} }