geforkt von Mirrors/Velocity
Make sure to schedule on the thread pool and not on the scheduler.
Dieser Commit ist enthalten in:
Ursprung
1e178cfe2a
Commit
01c1002249
@ -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() {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren