diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsConf.java | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java index ce3d43280..0352007e8 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java @@ -316,14 +316,12 @@ public class EssentialsConf extends YamlConfiguration } } + //This may be aborted if there are stagnant requests sitting in queue. + //This needs fixed to discard outstanding save requests. public synchronized void forceSave() { try { - if (pendingDiskWrites.get() > 0) - { - pendingDiskWrites.set(0); - } Future<?> future = delayedSave(configFile); if (future != null) { @@ -342,10 +340,7 @@ public class EssentialsConf extends YamlConfiguration public synchronized void cleanup() { - if (pendingDiskWrites.get() > 0) - { - forceSave(); - } + forceSave(); } private Future<?> delayedSave(final File file) @@ -362,11 +357,6 @@ public class EssentialsConf extends YamlConfiguration return null; } - if (pendingDiskWrites.incrementAndGet() < 0) - { - pendingDiskWrites.set(1); - } - Future<?> future = EXECUTOR_SERVICE.submit(new WriteRunner(configFile, data, pendingDiskWrites)); return future; |