mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-15 20:26:53 +02:00
Fix application crash when exiting due to failure state (#2244)
* Fix a potential crash when an unclean exit is performed and any database access cannot be cleanly shutdown
This commit is contained in:
parent
0b89a1fea0
commit
19727d9c57
10
src/itemdb.d
10
src/itemdb.d
|
@ -503,8 +503,14 @@ final class ItemDatabase
|
||||||
// Perform a vacuum on the database, commit WAL / SHM to file
|
// Perform a vacuum on the database, commit WAL / SHM to file
|
||||||
void performVacuum()
|
void performVacuum()
|
||||||
{
|
{
|
||||||
auto stmt = db.prepare("VACUUM;");
|
try {
|
||||||
stmt.exec();
|
auto stmt = db.prepare("VACUUM;");
|
||||||
|
stmt.exec();
|
||||||
|
} catch (SqliteException e) {
|
||||||
|
writeln();
|
||||||
|
log.error("ERROR: Unable to perform a database vacuum: " ~ e.msg);
|
||||||
|
writeln();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select distinct driveId items from database
|
// Select distinct driveId items from database
|
||||||
|
|
Loading…
Reference in a new issue