9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-29 11:49:08 +00:00

Revert "Fix server freeze by running config save async (YamlStorage)"

Caused the JVM to crash. This was unsafe. It's better to just let the server freeze (likely due to slow file system), and tell people to use SQLite instead.

This reverts commit bb58da00
This commit is contained in:
SamB440
2021-03-20 15:23:16 +00:00
parent 60148c0499
commit 226d31e9cf

View File

@@ -5,7 +5,6 @@ import net.islandearth.rpgregions.managers.data.IStorageManager;
import net.islandearth.rpgregions.managers.data.account.RPGRegionsAccount;
import net.islandearth.rpgregions.managers.data.region.Discovery;
import net.islandearth.rpgregions.managers.data.region.WorldDiscovery;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
@@ -146,13 +145,11 @@ public class YamlStorage implements IStorageManager {
}
config.set("Discoveries", newData);
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
try {
config.save(file);
} catch (IOException e) {
e.printStackTrace();
}
});
try {
config.save(file);
} catch (IOException e) {
e.printStackTrace();
}
cachedAccounts.remove(uuid);
}
}