mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-09 04:20:42 +01:00
Revert writecount reset, this could cause odd behavior.
This commit is contained in:
parent
4590e7ea26
commit
00655f724d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user