mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-10-31 23:29:14 +00:00
Hopefully fix discord being killed incorrectly
This commit is contained in:
parent
cc00f65e72
commit
82e70bef71
|
@ -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