mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-22 17:34:57 +00:00
Hopefully fix discord being killed incorrectly
This commit is contained in:
parent
d033b96376
commit
27f5019982
1 changed files with 9 additions and 6 deletions
|
@ -193,13 +193,16 @@ public class DiscordBridge {
|
|||
}
|
||||
CountDownLatch shutdownWaiter = new CountDownLatch(1);
|
||||
|
||||
DISCORD_API.addLostConnectionListener(lostConnectionEvent -> shutdownWaiter.countDown());
|
||||
DISCORD_API.disconnect();
|
||||
Thread t = new Thread(() -> {
|
||||
DISCORD_API.addLostConnectionListener(lostConnectionEvent -> shutdownWaiter.countDown());
|
||||
DISCORD_API.disconnect();
|
||||
|
||||
try {
|
||||
shutdownWaiter.await(30, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
try {
|
||||
shutdownWaiter.await(30, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue