Make sure to schedule on the thread pool and not on the scheduler.
This commit is contained in:
@@ -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() {
|
||||||
|
Reference in New Issue
Block a user