mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-01 04:51:26 +01:00
Vacuum is our friend
This commit is contained in:
parent
ecf07433df
commit
389424fbb8
@ -477,6 +477,7 @@ public abstract class JobsDAO {
|
|||||||
if (getConnection() == null)
|
if (getConnection() == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
vacuum();
|
||||||
setupConfig();
|
setupConfig();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -2646,6 +2647,24 @@ public abstract class JobsDAO {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized void vacuum() {
|
||||||
|
if (dbType != DataBaseType.SqLite)
|
||||||
|
return;
|
||||||
|
JobsConnection conn = getConnection();
|
||||||
|
if (conn == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
PreparedStatement prest = null;
|
||||||
|
try {
|
||||||
|
prest = conn.prepareStatement("VACUUM;");
|
||||||
|
prest.execute();
|
||||||
|
} catch (Exception | Error e) {
|
||||||
|
} finally {
|
||||||
|
close(prest);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close all active database handles
|
* Close all active database handles
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user