Created Async MySQL Saver

This commit is contained in:
Sn0wStorm
2020-01-23 22:18:14 +01:00
parent 5f076c4d2f
commit 00f541dafe
4 changed files with 274 additions and 0 deletions
+9
View File
@@ -23,6 +23,7 @@ import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.java.JavaPlugin;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
@@ -151,6 +152,14 @@ public class P extends JavaPlugin {
// save Data to Disk
DataSave.save(true);
if (BConfig.sqlSync != null) {
try {
BConfig.sqlSync.closeConnection();
} catch (SQLException ignored) {
}
BConfig.sqlSync = null;
}
// delete config data, in case this is a reload and to clear up some ram
clearConfigData();