aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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));