mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-26 18:54:44 +02:00
Potential fix for loss of data due to SQL connection dropping
The idea behind this change is to send a ping every hour, which is shorter than the driver's 'dead connection' threshold of 8 hours. As a side effect, this also will fix a subset of the situations where the MySQL server is restarted.
This commit is contained in:
@ -24,6 +24,7 @@ import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.runnables.database.SQLReconnectTask;
|
||||
import com.gmail.nossr50.runnables.database.SQLDatabaseKeepaliveTask;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
|
||||
public final class SQLDatabaseManager implements DatabaseManager {
|
||||
@ -51,6 +52,8 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
||||
|
||||
protected SQLDatabaseManager() {
|
||||
checkStructure();
|
||||
|
||||
new SQLDatabaseKeepaliveTask(this).runTaskTimerAsynchronously(mcMMO.p, 10, 60L * 60 * Misc.TICK_CONVERSION_FACTOR);
|
||||
}
|
||||
|
||||
public void purgePowerlessUsers() {
|
||||
|
Reference in New Issue
Block a user