Increase UserHousekeeper cleanup interval & print debug message when unloading

This commit is contained in:
Luck 2020-04-28 13:47:13 +01:00
parent 2fd896508b
commit b17da055af
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 5 additions and 1 deletions

View File

@ -57,7 +57,7 @@ public abstract class AbstractUserManager<T extends User> extends AbstractManage
public AbstractUserManager(LuckPermsPlugin plugin, UserHousekeeper.TimeoutSettings timeoutSettings) {
this.plugin = plugin;
this.housekeeper = new UserHousekeeper(plugin, this, timeoutSettings);
this.plugin.getBootstrap().getScheduler().asyncRepeating(this.housekeeper, 10, TimeUnit.SECONDS);
this.plugin.getBootstrap().getScheduler().asyncRepeating(this.housekeeper, 30, TimeUnit.SECONDS);
}
@Override

View File

@ -25,6 +25,7 @@
package me.lucko.luckperms.common.model.manager.user;
import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
import me.lucko.luckperms.common.util.ExpiringSet;
@ -78,6 +79,9 @@ public class UserHousekeeper implements Runnable {
}
// unload them
if (this.plugin.getConfiguration().get(ConfigKeys.DEBUG_LOGINS)) {
this.plugin.getLogger().info("User Housekeeper: unloading user data for " + uuid);
}
this.userManager.unload(uuid);
}