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:
Christian Kamm 2018-05-16 10:50:34 +02:00 committed by ckamm
parent ce06c96135
commit b1224cff0c

View File

@ -272,6 +272,11 @@ bool SyncJournalDb::sqlFail(const QString &log, const SqlQuery &query)
bool SyncJournalDb::checkConnect()
{
if (_db.isOpen()) {
if (!QFile::exists(_dbFile)) {
qCWarning(lcDb) << "Database open, but file file" + _dbFile + " does not exist";
close();
return false;
}
return true;
}