summaryrefslogtreecommitdiffstats
path: root/src/libserver/fuzzy_backend.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-24 16:38:32 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-24 16:38:32 +0000
commit83a4a320551f2ef7d1d818857326ebed6bd6b8cf (patch)
tree2733e0d4d903ed04439954153f0975886033a5de /src/libserver/fuzzy_backend.c
parentbf5604ebb1dc7ad2264f787ca2c32981053ddf7d (diff)
downloadrspamd-83a4a320551f2ef7d1d818857326ebed6bd6b8cf.tar.gz
rspamd-83a4a320551f2ef7d1d818857326ebed6bd6b8cf.zip
Slightly improve logging in fuzzy.
Diffstat (limited to 'src/libserver/fuzzy_backend.c')
-rw-r--r--src/libserver/fuzzy_backend.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libserver/fuzzy_backend.c b/src/libserver/fuzzy_backend.c
index e582de3bf..e90fb3146 100644
--- a/src/libserver/fuzzy_backend.c
+++ b/src/libserver/fuzzy_backend.c
@@ -290,7 +290,8 @@ rspamd_fuzzy_backend_run_stmt (struct rspamd_fuzzy_backend *backend,
stmt = prepared_stmts[idx].stmt;
}
- msg_debug_fuzzy_backend ("executing `%s`", prepared_stmts[idx].sql);
+ msg_debug_fuzzy_backend ("executing `%s` %s auto cleanup",
+ prepared_stmts[idx].sql, auto_cleanup ? "with" : "without");
argtypes = prepared_stmts[idx].args;
sqlite3_clear_bindings (stmt);
sqlite3_reset (stmt);
@@ -324,8 +325,9 @@ retry:
if (retcode == prepared_stmts[idx].result) {
return SQLITE_OK;
}
- else if (retcode != SQLITE_DONE) {
- if (retcode == SQLITE_BUSY && retries++ < max_retries) {
+ else {
+ if ((retcode == SQLITE_BUSY ||
+ retcode == SQLITE_LOCKED) && retries++ < max_retries) {
double_to_ts (sql_sleep_time, &ts);
nanosleep (&ts, NULL);
goto retry;