mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-25 12:25:37 +01:00
Fixed SQLite purges not successfully completing on some systems
This commit is contained in:
parent
947c59882e
commit
03bd19480e
@ -94,12 +94,14 @@ public class PurgeCommand extends Consumer {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try (Connection connection = Database.getConnection(false, 500)) {
|
||||
try {
|
||||
long timestamp = (System.currentTimeMillis() / 1000L);
|
||||
long ptime = timestamp - seconds;
|
||||
long removed = 0;
|
||||
|
||||
Connection connection = null;
|
||||
for (int i = 0; i <= 5; i++) {
|
||||
connection = Database.getConnection(false, 500);
|
||||
if (connection != null) {
|
||||
break;
|
||||
}
|
||||
@ -342,6 +344,8 @@ public class PurgeCommand extends Consumer {
|
||||
}
|
||||
}
|
||||
|
||||
connection.close();
|
||||
|
||||
if (abort) {
|
||||
if (!Config.getGlobal().MYSQL) {
|
||||
(new File(ConfigHandler.path + ConfigHandler.sqlite + ".tmp")).delete();
|
||||
|
Loading…
Reference in New Issue
Block a user