mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-11-08 03:39:42 +01:00
Don't register the currently running task again inside the task
Affects issues: - Fixed #1715
This commit is contained in:
parent
97096948dc
commit
94abd68086
@ -128,6 +128,7 @@ public class DBCleanTask extends TaskSystem.Task {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void register(RunnableFactory runnableFactory) {
|
public void register(RunnableFactory runnableFactory) {
|
||||||
|
AbsRunnable taskToRegister = this;
|
||||||
// Secondary task for registration due to database queries.
|
// Secondary task for registration due to database queries.
|
||||||
runnableFactory.create(null, new AbsRunnable() {
|
runnableFactory.create(null, new AbsRunnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -145,7 +146,7 @@ public class DBCleanTask extends TaskSystem.Task {
|
|||||||
|
|
||||||
long delay = TimeAmount.toTicks(startAfter, TimeUnit.MILLISECONDS);
|
long delay = TimeAmount.toTicks(startAfter, TimeUnit.MILLISECONDS);
|
||||||
long period = TimeAmount.toTicks(config.get(TimeSettings.CLEAN_DATABASE_PERIOD), TimeUnit.MILLISECONDS);
|
long period = TimeAmount.toTicks(config.get(TimeSettings.CLEAN_DATABASE_PERIOD), TimeUnit.MILLISECONDS);
|
||||||
runnableFactory.create(null, this).runTaskTimerAsynchronously(delay, period);
|
runnableFactory.create(null, taskToRegister).runTaskTimerAsynchronously(delay, period);
|
||||||
}
|
}
|
||||||
}).runTaskAsynchronously();
|
}).runTaskAsynchronously();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user