13
0
geforkt von Mirrors/Velocity

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 @Override
public void cancel() { public void cancel() {
if (future != null) { if (future != null) {
future.cancel(true); future.cancel(false);
onFinish(); onFinish();
} }
} }
@Override @Override
public void run() { public void run() {
try { taskService.execute(() -> {
runnable.run(); try {
} catch (Exception e) { runnable.run();
// Since we can't catch InterruptedException separately... } catch (Exception e) {
if (e instanceof InterruptedException) { // Since we can't catch InterruptedException separately...
onFinish(); if (e instanceof InterruptedException) {
} else { onFinish();
Log.logger.error("Exception in task {} by plugin {}", runnable, plugin); } else {
Log.logger.error("Exception in task {} by plugin {}", runnable, plugin);
}
} }
} });
} }
private void onFinish() { private void onFinish() {