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:
t00thpick1
2014-08-03 21:12:41 -04:00
parent 966de87ef9
commit ae5347bc0f
3 changed files with 9 additions and 50 deletions

View File

@ -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();
}
}