Fixed bug where database saving was every 5 ticks.

Changed to calculate minutes for database backup time.
This commit is contained in:
tastybento 2018-06-17 18:18:35 -07:00
parent 8353d266a5
commit fba05ecc81

View File

@ -121,10 +121,11 @@ public class BSkyBlock extends JavaPlugin {
islandsManager.load();
// Save islands & players data asynchronously every X minutes
instance.getServer().getScheduler().runTaskTimer(instance, () -> {
playersManager.save(true);
islandsManager.save(true);
}, getSettings().getDatabaseBackupPeriod(), getSettings().getDatabaseBackupPeriod());
}, getSettings().getDatabaseBackupPeriod() * 20 * 60L, getSettings().getDatabaseBackupPeriod() * 20 * 60L);
instance.log("#############################################");
instance.log(instance.getDescription().getFullName() + " has been fully enabled.");