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