diff --git a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/TransferTable.java b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/TransferTable.java index 7877fc22c..c959d680b 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/TransferTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/TransferTable.java @@ -85,13 +85,13 @@ public class TransferTable extends Table { execute(new ExecStatement(sql) { @Override public void prepare(PreparedStatement statement) throws SQLException { - statement.setLong(1, MiscUtils.getTime() + TimeAmount.MINUTE.ms()); + statement.setLong(1, MiscUtils.getTime()); statement.setString(2, "onlineStatus"); } }); sql = "DELETE FROM " + tableName + " WHERE " + columnSenderID + " = " + serverTable.statementSelectServerID + - " AND " + columnInfoType + " != ?"; + " AND " + columnInfoType + " = ?"; execute(new ExecStatement(sql) { @Override diff --git a/Plan/src/main/java/com/djrapitops/plan/system/settings/network/NetworkSettings.java b/Plan/src/main/java/com/djrapitops/plan/system/settings/network/NetworkSettings.java index 5153d7a92..e4ee48510 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/settings/network/NetworkSettings.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/settings/network/NetworkSettings.java @@ -54,8 +54,6 @@ public class NetworkSettings { return; } - Log.debug("Saving Config settings to database."); - Processor.queue(() -> { try { new NetworkSettings().placeToDatabase(); @@ -66,22 +64,25 @@ public class NetworkSettings { } public void loadFromDatabase() throws DBException, UnsupportedTransferDatabaseException { + Log.debug("NetworkSettings: Fetch Config settings from database.."); Optional encodedConfigSettings = Database.getActive().transfer().getEncodedConfigSettings(); if (!encodedConfigSettings.isPresent()) { - Log.debug("No Config settings in database."); + Log.debug("NetworkSettings: No Config settings in database."); return; } String configSettings = Base64Util.decode(encodedConfigSettings.get()); Map pathValueMap = getPathsAndValues(configSettings); + Log.debug("NetworkSettings: Updating Settings"); ServerSpecificSettings.updateSettings(pathValueMap); } private Map getPathsAndValues(String configSettings) { Map pathValueMap = new HashMap<>(); + Log.debug("NetworkSettings: Reading Config String.."); String[] settings = configSettings.split(SPLIT); UUID thisServerUUID = ServerInfo.getServerUUID(); for (String settingAndVal : settings) { @@ -108,6 +109,7 @@ public class NetworkSettings { public void placeToDatabase() throws DBException, UnsupportedTransferDatabaseException { Map configValues = getConfigValues(); + Log.debug("NetworkSettings: Building Base64 String.."); StringBuilder transferBuilder = new StringBuilder(); int size = configValues.size(); int i = 0; @@ -125,10 +127,12 @@ public class NetworkSettings { String base64 = Base64Util.encode(transferBuilder.toString()); + Log.debug("NetworkSettings: Saving Config settings to database.."); Database.getActive().transfer().storeConfigSettings(base64); } private Map getConfigValues() throws DBException { + Log.debug("NetworkSettings: Loading Config Values.."); Map configValues = new HashMap<>(); addConfigValue(configValues, Settings.DB_TYPE, "mysql"); Settings[] sameStrings = new Settings[]{ @@ -138,6 +142,7 @@ public class NetworkSettings { Settings.FORMAT_MINUTES, Settings.FORMAT_MONTHS, Settings.FORMAT_MONTH, Settings.FORMAT_YEAR, Settings.FORMAT_YEARS, Settings.FORMAT_ZERO_SECONDS }; + Log.debug("NetworkSettings: Adding Config Values.."); for (Settings setting : sameStrings) { addConfigValue(configValues, setting, setting.toString()); } @@ -159,6 +164,7 @@ public class NetworkSettings { } private void addServerSpecificValues(Map configValues) throws DBException { + Log.debug("NetworkSettings: Adding Server-specific Config Values.."); ServerSpecificSettings settings = Settings.serverSpecific(); for (UUID serverUUID : Database.getActive().fetch().getServerUUIDs()) {