Dont let render-threads die. If an error occurs, let them wait for a while, then resurrect them

This commit is contained in:
Blue (Lukas Rieger) 2020-07-29 20:16:20 +02:00
parent ca4fec8c1a
commit 7405520713

View File

@ -161,11 +161,19 @@ private void renderThread() {
}
if (ticket != null) {
ticket.render();
try {
ticket.render();
} catch (Exception e) {
//catch possible runtime exceptions, display them, and wait a while .. then resurrect this render-thread
Logger.global.logError("Unexpected exception in render-thread!", e);
try {
Thread.sleep(10000);
} catch (InterruptedException interrupt) { break; }
}
} else {
try {
Thread.sleep(1000); // we don't need a super fast response time, so waiting a second is totally fine
} catch (InterruptedException e) { break; }
} catch (InterruptedException interrupt) { break; }
}
}
}