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
|
||||
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() {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren