mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
Sqlite3: Switch to WAL
This is faster.
This commit is contained in:
parent
0fb779d363
commit
5d048c18bc
2 changed files with 13 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue