aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/fuzzy_backend.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-08 09:41:43 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-08 09:41:43 +0000
commitde15460cb76953d0b8c149970adc510a0af495ac (patch)
treee682c103a5b30708e163a1a0e6332ebeb8cab50f /src/libserver/fuzzy_backend.c
parent6adf93104e4e1c9ae2f638de9b6d38a4c0f750fd (diff)
downloadrspamd-de15460cb76953d0b8c149970adc510a0af495ac.tar.gz
rspamd-de15460cb76953d0b8c149970adc510a0af495ac.zip
Rollback failed transaction.
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);
}
}
}