[Pkg-owncloud-commits] [owncloud-client] 139/211: Sqlite3: Switch to WAL

Sandro Knauß hefee-guest at moszumanska.debian.org
Sat Oct 25 09:10:38 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 5d048c18bc22c16f047afaee9a772b39f8e8c6c2
Author: Markus Goetz <markus at woboq.com>
Date:   Mon Oct 20 22:38:10 2014 +0200

    Sqlite3: Switch to WAL
    
    This is faster.
---
 csync/src/csync_update.c     | 5 ++++-
 src/mirall/syncjournaldb.cpp | 9 +++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/csync/src/csync_update.c b/csync/src/csync_update.c
index a064e4f..1a12b22 100644
--- a/csync/src/csync_update.c
+++ b/csync/src/csync_update.c
@@ -632,10 +632,13 @@ int csync_ftw(CSYNC *ctx, const char *uri, csync_walker_fn fn,
     path = filename + ulen;
 
     /* skip ".csync_journal.db" and ".csync_journal.db.ctmp" */
+    /* Isn't this done via csync_exclude already? */
     if (c_streq(path, ".csync_journal.db")
             || c_streq(path, ".csync_journal.db.ctmp")
             || c_streq(path, ".csync_journal.db.ctmp-journal")
-            || c_streq(path, ".csync-progressdatabase")) {
+            || c_streq(path, ".csync-progressdatabase")
+            || c_streq(path, ".csync_journal.db-shm")
+            || c_streq(path, ".csync_journal.db-wal")) {
         csync_vio_file_stat_destroy(dirent);
         dirent = NULL;
         SAFE_FREE(filename);
diff --git a/src/mirall/syncjournaldb.cpp b/src/mirall/syncjournaldb.cpp
index 569e230..c929082 100644
--- a/src/mirall/syncjournaldb.cpp
+++ b/src/mirall/syncjournaldb.cpp
@@ -120,6 +120,15 @@ bool SyncJournalDb::checkConnect()
         qDebug() << "sqlite3 version" << pragma1.stringValue(0);
     }
 
+    pragma1.prepare("PRAGMA journal_mode=WAL;");
+    if (!pragma1.exec()) {
+        return sqlFail("Set PRAGMA synchronous", pragma1);
+    } else {
+        pragma1.next();
+        qDebug() << "sqlite3 journal_mode=" << pragma1.stringValue(0);
+
+    }
+
     pragma1.prepare("PRAGMA synchronous = 1;");
     if (!pragma1.exec()) {
         return sqlFail("Set PRAGMA synchronous", pragma1);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list