diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-11-01 12:12:32 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-11-01 12:12:32 +0000 |
commit | 57f9bc06b0169326a5065640eeb977d7f32c1c86 (patch) | |
tree | 068f9f697c585c2663139ce89d54dd79641fe220 /EssentialsGroupManager | |
parent | 97cae6c0cbec86d18b53e6e5acfbf149e2b80179 (diff) | |
download | Essentials-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')
-rw-r--r-- | EssentialsGroupManager/src/Changelog.txt | 3 | ||||
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index cc9192da9..5264a88b9 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -63,4 +63,5 @@ v 1.5: - Fixed an error on 'manucheckv'. If the users doesn't have the variable it fell through causing an exception.
- Added checking of subgroups for Info nodes.
- Expanded 'canUserBuild()' to include inheritance and subgroups.
- - Added a config.yml setting of 'validate_toggle' for those who prefer 'mantogglevalidate' to always be off.
\ No newline at end of file + - Added a config.yml setting of 'validate_toggle' for those who prefer 'mantogglevalidate' to always be off.
+ - Prevent setting 'minutes' in the config to zero causing an error.
\ No newline at end of file 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!"); } } |