mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-10 09:46:40 +02:00
Resolve 'database is locked' message and crash
* Resolve 'database is locked' when another onedrive process is running and has exclusive access to the database
This commit is contained in:
parent
dc4bfb62ff
commit
2576b69a88
|
@ -1,5 +1,5 @@
|
|||
module sqlite;
|
||||
|
||||
import std.stdio;
|
||||
import etc.c.sqlite3;
|
||||
import std.string: fromStringz, toStringz;
|
||||
|
||||
|
@ -133,6 +133,11 @@ struct Statement
|
|||
{
|
||||
// https://www.sqlite.org/c3ref/step.html
|
||||
int rc = sqlite3_step(pStmt);
|
||||
if (rc == SQLITE_BUSY) {
|
||||
// Database is locked by another onedrive process
|
||||
writeln("The database is currently locked by another process - cannot sync");
|
||||
return;
|
||||
}
|
||||
if (rc == SQLITE_DONE) {
|
||||
row.length = 0;
|
||||
} else if (rc == SQLITE_ROW) {
|
||||
|
|
Loading…
Reference in a new issue