mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Purging shouldn't be main thread, also we have no reason to refresh profiles of purged users, as old users aren't online, and powerless users have nothing to wipe.
This commit is contained in:
@ -1,17 +1,22 @@
|
||||
package com.gmail.nossr50.runnables.database;
|
||||
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
|
||||
public class UserPurgeTask extends BukkitRunnable {
|
||||
private ReentrantLock lock = new ReentrantLock();
|
||||
@Override
|
||||
public void run() {
|
||||
lock.lock();
|
||||
mcMMO.getDatabaseManager().purgePowerlessUsers();
|
||||
|
||||
if (Config.getInstance().getOldUsersCutoff() != -1) {
|
||||
mcMMO.getDatabaseManager().purgeOldUsers();
|
||||
}
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user