From 3df40b205ea83204b69e4ff4f1571b2fb187159b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 29 Apr 2008 14:19:50 +0200 Subject: [PATCH] Fix return value of csync_journal_load and add sqlite3 optimization. --- src/csync_journal.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/csync_journal.c b/src/csync_journal.c index 660dbb9388..fe10345a58 100644 --- a/src/csync_journal.c +++ b/src/csync_journal.c @@ -86,6 +86,7 @@ static int csync_journal_is_empty(CSYNC *ctx) { int csync_journal_load(CSYNC *ctx, const char *journal) { int rc = -1; + c_strlist_t *result = NULL; char *journal_tmp = NULL; if (csync_journal_check(journal) < 0) { @@ -122,9 +123,14 @@ int csync_journal_load(CSYNC *ctx, const char *journal) { ctx->journal.exists = 1; } + /* optimization for speeding up SQLite */ + result = csync_journal_query(ctx, "PRAGMA default_synchronous = OFF;"); + c_strlist_destroy(result); + + rc = 0; out: SAFE_FREE(journal_tmp); - return 0; + return rc; } int csync_journal_write(CSYNC *ctx) {