mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-12 15:56:00 +08:00
Added a DataContainerCache clean task
This commit is contained in:
parent
e73b89d9de
commit
0c5fbb160f
@ -7,6 +7,9 @@ package com.djrapitops.plan.system.cache;
|
|||||||
import com.djrapitops.plan.api.exceptions.EnableException;
|
import com.djrapitops.plan.api.exceptions.EnableException;
|
||||||
import com.djrapitops.plan.system.PlanSystem;
|
import com.djrapitops.plan.system.PlanSystem;
|
||||||
import com.djrapitops.plan.system.SubSystem;
|
import com.djrapitops.plan.system.SubSystem;
|
||||||
|
import com.djrapitops.plugin.api.TimeAmount;
|
||||||
|
import com.djrapitops.plugin.task.AbsRunnable;
|
||||||
|
import com.djrapitops.plugin.task.RunnableFactory;
|
||||||
import com.djrapitops.plugin.utilities.Verify;
|
import com.djrapitops.plugin.utilities.Verify;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,6 +43,13 @@ public class CacheSystem implements SubSystem {
|
|||||||
public void enable() throws EnableException {
|
public void enable() throws EnableException {
|
||||||
dataCache.enable();
|
dataCache.enable();
|
||||||
geolocationCache.enable();
|
geolocationCache.enable();
|
||||||
|
|
||||||
|
RunnableFactory.createNew("DataContainer cache clean task", new AbsRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
dataContainerCache.clear();
|
||||||
|
}
|
||||||
|
}).runTaskTimerAsynchronously(TimeAmount.MINUTE.ticks(), TimeAmount.MINUTE.ms());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user