Cleanup un-needed changes

This commit is contained in:
jglrxavpok 2021-08-28 14:27:52 +02:00
parent 85ca2a5302
commit b1b1e70c40
2 changed files with 3 additions and 6 deletions

View File

@ -184,9 +184,9 @@ public final class SchedulerManager implements IExtensionObserver {
}
/**
* Gets the execution service for all the registered {@link Task}, which are not marked as thread-bound.
* Gets the execution service for all the registered {@link Task}
*
* @return the execution service for all the registered {@link Task}, which are not marked as thread-bound
* @return the execution service for all the registered {@link Task}
*/
@NotNull
public ExecutorService getBatchesPool() {

View File

@ -43,8 +43,6 @@ public class Task implements Runnable {
private ScheduledFuture<?> future;
// The thread of the task
private volatile Thread currentThreadTask;
// The executor service used for this task
private final ExecutorService executorService;
/**
* Creates a task.
@ -60,7 +58,6 @@ public class Task implements Runnable {
this.runnable = runnable;
this.shutdown = shutdown;
this.id = shutdown ? this.schedulerManager.getShutdownCounterIdentifier() : this.schedulerManager.getCounterIdentifier();
this.executorService = this.schedulerManager.getBatchesPool();
this.delay = delay;
this.repeat = repeat;
this.isTransient = isTransient;
@ -72,7 +69,7 @@ public class Task implements Runnable {
*/
@Override
public void run() {
executorService.execute(() -> {
this.schedulerManager.getBatchesPool().execute(() -> {
this.currentThreadTask = Thread.currentThread();
try {
this.runnable.run();