mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
SyncJournal: Check file existence even for open dbs #6049
With WAL mode sqlite seems to occasionally crash when the underlying filesystem goes away.
This commit is contained in:
parent
a348ff3134
commit
cc04ce9fe4
1 changed files with 5 additions and 0 deletions
|
@ -273,6 +273,11 @@ bool SyncJournalDb::sqlFail(const QString &log, const SqlQuery &query)
|
||||||
bool SyncJournalDb::checkConnect()
|
bool SyncJournalDb::checkConnect()
|
||||||
{
|
{
|
||||||
if (_db.isOpen()) {
|
if (_db.isOpen()) {
|
||||||
|
if (!QFile::exists(_dbFile)) {
|
||||||
|
qCWarning(lcDb) << "Database open, but file file" + _dbFile + " does not exist";
|
||||||
|
close();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue