mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-02 14:12:52 +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
|
||||
void performVacuum()
|
||||
{
|
||||
auto stmt = db.prepare("VACUUM;");
|
||||
stmt.exec();
|
||||
try {
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue