Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2022-07-14 13:19:00 +0300
committerHannah von Reth <hannah.vonreth@owncloud.com>2022-07-22 12:14:40 +0300
commit8351736e6b938bf6585275260522a00c33f82116 (patch)
tree20873899ee9fc148d0339a23c46f3cc75adccf0e
parent4ee1193be5a2646862f43fb606d5f4ce325a66cb (diff)
Don't check for db existswork/if_exists
In context of #6049 a check for the existance of the db file was introduced. That check is performed before every db access... so several 100 times per second.
-rw-r--r--changelog/unreleased/99189
-rw-r--r--src/common/syncjournaldb.cpp7
2 files changed, 9 insertions, 7 deletions
diff --git a/changelog/unreleased/9918 b/changelog/unreleased/9918
new file mode 100644
index 000000000..8fe91d59e
--- /dev/null
+++ b/changelog/unreleased/9918
@@ -0,0 +1,9 @@
+Enhancement: We improved the performance of db access
+
+We removed a check for the existence of the db that was executed before every access to the db.
+
+The check was introduced in #6049 to prevent crashes if the db does not exist or is removed during runtime.
+We nowadays gracefully handle missing dbs on startup, removing the db at runtime is too much of a corner case
+to sacrifice that much performance however.
+
+https://github.com/owncloud/client/pull/9918
diff --git a/src/common/syncjournaldb.cpp b/src/common/syncjournaldb.cpp
index aeebb03ae..d52b3740e 100644
--- a/src/common/syncjournaldb.cpp
+++ b/src/common/syncjournaldb.cpp
@@ -262,13 +262,6 @@ bool SyncJournalDb::checkConnect()
}
if (_db.isOpen()) {
- // Unfortunately the sqlite isOpen check can return true even when the underlying storage
- // has become unavailable - and then some operations may cause crashes. See #6049
- if (!QFile::exists(_dbFile)) {
- qCWarning(lcDb) << "Database open, but file" << _dbFile << "does not exist";
- close();
- return false;
- }
return true;
}