Fixed SQLite purges not successfully completing on some systems
This commit is contained in:
parent
947c59882e
commit
03bd19480e
1 changed files with 5 additions and 1 deletions
|
|
@ -94,12 +94,14 @@ public class PurgeCommand extends Consumer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try (Connection connection = Database.getConnection(false, 500)) {
|
try {
|
||||||
long timestamp = (System.currentTimeMillis() / 1000L);
|
long timestamp = (System.currentTimeMillis() / 1000L);
|
||||||
long ptime = timestamp - seconds;
|
long ptime = timestamp - seconds;
|
||||||
long removed = 0;
|
long removed = 0;
|
||||||
|
|
||||||
|
Connection connection = null;
|
||||||
for (int i = 0; i <= 5; i++) {
|
for (int i = 0; i <= 5; i++) {
|
||||||
|
connection = Database.getConnection(false, 500);
|
||||||
if (connection != null) {
|
if (connection != null) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -342,6 +344,8 @@ public class PurgeCommand extends Consumer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connection.close();
|
||||||
|
|
||||||
if (abort) {
|
if (abort) {
|
||||||
if (!Config.getGlobal().MYSQL) {
|
if (!Config.getGlobal().MYSQL) {
|
||||||
(new File(ConfigHandler.path + ConfigHandler.sqlite + ".tmp")).delete();
|
(new File(ConfigHandler.path + ConfigHandler.sqlite + ".tmp")).delete();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue