summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager/src/org
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2011-11-01 12:12:32 +0000
committerElgarL <ElgarL@palmergames.com>2011-11-01 12:12:32 +0000
commit57f9bc06b0169326a5065640eeb977d7f32c1c86 (patch)
tree068f9f697c585c2663139ce89d54dd79641fe220 /EssentialsGroupManager/src/org
parent97cae6c0cbec86d18b53e6e5acfbf149e2b80179 (diff)
downloadEssentials-57f9bc06b0169326a5065640eeb977d7f32c1c86.tar
Essentials-57f9bc06b0169326a5065640eeb977d7f32c1c86.tar.gz
Essentials-57f9bc06b0169326a5065640eeb977d7f32c1c86.tar.lz
Essentials-57f9bc06b0169326a5065640eeb977d7f32c1c86.tar.xz
Essentials-57f9bc06b0169326a5065640eeb977d7f32c1c86.zip
Prevent setting 'minutes' in the config to zero causing an error.
Diffstat (limited to 'EssentialsGroupManager/src/org')
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index bbe5cae09..ff77a76a4 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -88,10 +88,10 @@ public class GroupManager extends JavaPlugin {
public void onDisable() {
setLoaded(false);
+ disableScheduler(); // Shutdown before we save, so it doesn't interfere.
if (worldsHolder != null) {
worldsHolder.saveChanges();
}
- disableScheduler();
WorldEvents = null;
BukkitPermissions = null;
@@ -181,9 +181,13 @@ public class GroupManager extends JavaPlugin {
}
};
scheduler = new ScheduledThreadPoolExecutor(1);
- int minutes = getGMConfig().getSaveInterval();
+ long minutes = (long)getGMConfig().getSaveInterval();
+ if (minutes > 0) {
scheduler.scheduleAtFixedRate(commiter, minutes, minutes, TimeUnit.MINUTES);
- GroupManager.logger.info("Scheduled Data Saving is set for every " + minutes + " minutes!");
+ GroupManager.logger.info("Scheduled Data Saving is set for every " + minutes + " minutes!");
+ } else
+ GroupManager.logger.info("Scheduled Data Saving is Disabled!");
+
GroupManager.logger.info("Backups will be retained for " + getGMConfig().getBackupDuration() + " hours!");
}
}