3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-09-29 06:30:16 +02:00

Make sure to schedule on the thread pool and not on the scheduler.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-08-26 18:43:55 -04:00
Ursprung 1e178cfe2a
Commit 01c1002249

Datei anzeigen

@ -185,23 +185,25 @@ public class VelocityScheduler implements Scheduler {
@Override
public void cancel() {
if (future != null) {
future.cancel(true);
future.cancel(false);
onFinish();
}
}
@Override
public void run() {
try {
runnable.run();
} catch (Exception e) {
// Since we can't catch InterruptedException separately...
if (e instanceof InterruptedException) {
onFinish();
} else {
Log.logger.error("Exception in task {} by plugin {}", runnable, plugin);
taskService.execute(() -> {
try {
runnable.run();
} catch (Exception e) {
// Since we can't catch InterruptedException separately...
if (e instanceof InterruptedException) {
onFinish();
} else {
Log.logger.error("Exception in task {} by plugin {}", runnable, plugin);
}
}
}
});
}
private void onFinish() {