aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-20 22:56:59 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-20 22:56:59 +0100
commit1aa3dd206e89e935e61eadaf6ea650903d3d3131 (patch)
tree0abfe558d4a1c9bd81a3c0018f47956154835e89 /src
parenta87e53fc9647f4a67f087a77b90da46d52421589 (diff)
downloadrspamd-1aa3dd206e89e935e61eadaf6ea650903d3d3131.tar.gz
rspamd-1aa3dd206e89e935e61eadaf6ea650903d3d3131.zip
Fallback to no journal if WAL is not available.
Diffstat (limited to 'src')
-rw-r--r--src/libstat/backends/sqlite3_backend.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstat/backends/sqlite3_backend.c b/src/libstat/backends/sqlite3_backend.c
index d784cea20..c85d774d8 100644
--- a/src/libstat/backends/sqlite3_backend.c
+++ b/src/libstat/backends/sqlite3_backend.c
@@ -288,7 +288,8 @@ rspamd_sqlite3_opendb (const gchar *path, const ucl_object_t *opts,
struct rspamd_stat_sqlite3_db *bk;
sqlite3 *sqlite;
gint rc, flags;
- static const char sqlite_wal[] = "PRAGMA journal_mode=WAL;";
+ static const char sqlite_wal[] = "PRAGMA journal_mode=WAL;",
+ fallback_journal[] = "PRAGMA journal_mode=OFF;";
flags = SQLITE_OPEN_READWRITE;
@@ -318,6 +319,7 @@ rspamd_sqlite3_opendb (const gchar *path, const ucl_object_t *opts,
if (sqlite3_exec (sqlite, sqlite_wal, NULL, NULL, NULL) != SQLITE_OK) {
msg_warn ("WAL mode is not supported, locking issues might occur");
+ sqlite3_exec (sqlite, fallback_journal, NULL, NULL, NULL);
}
bk = g_slice_alloc0 (sizeof (*bk));