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