Skip to content

Commit 0c5fbb1

Browse files
committed
Added a DataContainerCache clean task
1 parent e73b89d commit 0c5fbb1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Plan/src/main/java/com/djrapitops/plan/system/cache/CacheSystem.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
import com.djrapitops.plan.api.exceptions.EnableException;
88
import com.djrapitops.plan.system.PlanSystem;
99
import com.djrapitops.plan.system.SubSystem;
10+
import com.djrapitops.plugin.api.TimeAmount;
11+
import com.djrapitops.plugin.task.AbsRunnable;
12+
import com.djrapitops.plugin.task.RunnableFactory;
1013
import com.djrapitops.plugin.utilities.Verify;
1114

1215
/**
@@ -40,6 +43,13 @@ public static CacheSystem getInstance() {
4043
public void enable() throws EnableException {
4144
dataCache.enable();
4245
geolocationCache.enable();
46+
47+
RunnableFactory.createNew("DataContainer cache clean task", new AbsRunnable() {
48+
@Override
49+
public void run() {
50+
dataContainerCache.clear();
51+
}
52+
}).runTaskTimerAsynchronously(TimeAmount.MINUTE.ticks(), TimeAmount.MINUTE.ms());
4353
}
4454

4555
@Override

0 commit comments

Comments
 (0)