mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-28 03:57:50 +01:00
Add few try-catches
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
785bcb8b6d
commit
69e9b31fa4
@ -44,10 +44,18 @@ public final class Worker extends MinestomThread {
|
||||
public void run() {
|
||||
while (server.isOpen()) {
|
||||
try {
|
||||
this.queue.drain(Runnable::run);
|
||||
try {
|
||||
this.queue.drain(Runnable::run);
|
||||
} catch (Exception e) {
|
||||
MinecraftServer.getExceptionManager().handleException(e);
|
||||
}
|
||||
// Flush all connections if needed
|
||||
if (flush.compareAndSet(true, false)) {
|
||||
connectionMap.values().forEach(PlayerSocketConnection::flushSync);
|
||||
try {
|
||||
connectionMap.values().forEach(PlayerSocketConnection::flushSync);
|
||||
} catch (Exception e) {
|
||||
MinecraftServer.getExceptionManager().handleException(e);
|
||||
}
|
||||
}
|
||||
// Wait for an event
|
||||
this.selector.select(key -> {
|
||||
|
Loading…
Reference in New Issue
Block a user