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

This commit is contained in:
Andrew Steinborn
2018-08-26 18:43:55 -04:00
parent 1e178cfe2a
commit 01c1002249

View File

@@ -185,13 +185,14 @@ 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() {
taskService.execute(() -> {
try { try {
runnable.run(); runnable.run();
} catch (Exception e) { } catch (Exception e) {
@@ -202,6 +203,7 @@ public class VelocityScheduler implements Scheduler {
Log.logger.error("Exception in task {} by plugin {}", runnable, plugin); Log.logger.error("Exception in task {} by plugin {}", runnable, plugin);
} }
} }
});
} }
private void onFinish() { private void onFinish() {