aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/fuzzy_backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserver/fuzzy_backend.c')
-rw-r--r--src/libserver/fuzzy_backend.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libserver/fuzzy_backend.c b/src/libserver/fuzzy_backend.c
index 7ac492c36..fd1f9e4d0 100644
--- a/src/libserver/fuzzy_backend.c
+++ b/src/libserver/fuzzy_backend.c
@@ -758,6 +758,11 @@ rspamd_fuzzy_backend_sync (struct rspamd_fuzzy_backend *backend,
ret = rspamd_fuzzy_backend_run_stmt (backend,
RSPAMD_FUZZY_BACKEND_TRANSACTION_COMMIT);
+
+ if (ret != SQLITE_OK) {
+ rspamd_fuzzy_backend_run_stmt (backend,
+ RSPAMD_FUZZY_BACKEND_TRANSACTION_ROLLBACK);
+ }
}
if (ret != SQLITE_OK) {
msg_warn_fuzzy_backend ("cannot expire db: %s",
@@ -819,7 +824,8 @@ rspamd_fuzzy_backend_sync (struct rspamd_fuzzy_backend *backend,
msg_warn_fuzzy_backend (
"cannot synchronize fuzzy backend: %e",
err);
- g_error_free (err);
+ rspamd_fuzzy_backend_run_stmt (backend,
+ RSPAMD_FUZZY_BACKEND_TRANSACTION_ROLLBACK);
}
}
}