diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-24 14:39:21 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-02-24 14:39:21 +0000 |
commit | 136560c66397009a313b61239a455aad11f724f2 (patch) | |
tree | 1878a51df59c494e4a1ce15c21fcddd62166806d /src | |
parent | aaeb83acfc2b5b9760c8593d58517c4f6962052a (diff) | |
download | rspamd-136560c66397009a313b61239a455aad11f724f2.tar.gz rspamd-136560c66397009a313b61239a455aad11f724f2.zip |
[Minor] Improve fuzzy updates logging
Diffstat (limited to 'src')
-rw-r--r-- | src/fuzzy_storage.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index b78350800..073e66965 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -444,9 +444,6 @@ rspamd_fuzzy_stat_callback (EV_P_ ev_timer *w, int revents) static void fuzzy_update_version_callback (guint64 ver, void *ud) { - msg_info ("updated fuzzy storage from %s: version: %d", - (const char *)ud, (gint)ver); - g_free (ud); } static void @@ -467,14 +464,17 @@ rspamd_fuzzy_updates_cb (gboolean success, if (success) { rspamd_fuzzy_backend_count (ctx->backend, fuzzy_count_callback, ctx); - msg_info ("successfully updated fuzzy storage: %d updates in queue; " + msg_info ("successfully updated fuzzy storage %s: %d updates in queue; " "%d pending currently; " - "%d added, %d deleted, %d extended, %d duplicates", + "%d added; %d deleted; %d extended; %d duplicates", + ctx->worker->cf->bind_conf ? + ctx->worker->cf->bind_conf->bind_line : + "unknown", cbdata->updates_pending->len, ctx->updates_pending->len, nadded, ndeleted, nextended, nignored); rspamd_fuzzy_backend_version (ctx->backend, source, - fuzzy_update_version_callback, g_strdup (source)); + fuzzy_update_version_callback, NULL); ctx->updates_failed = 0; if (cbdata->final || ctx->worker->state != rspamd_worker_state_running) { @@ -484,8 +484,11 @@ rspamd_fuzzy_updates_cb (gboolean success, } else { if (++ctx->updates_failed > ctx->updates_maxfail) { - msg_err ("cannot commit update transaction to fuzzy backend, discard " + msg_err ("cannot commit update transaction to fuzzy backend %s, discard " "%ud updates after %d retries", + ctx->worker->cf->bind_conf ? + ctx->worker->cf->bind_conf->bind_line : + "unknown", cbdata->updates_pending->len, ctx->updates_maxfail); ctx->updates_failed = 0; @@ -496,9 +499,12 @@ rspamd_fuzzy_updates_cb (gboolean success, } } else { - msg_err ("cannot commit update transaction to fuzzy backend, " + msg_err ("cannot commit update transaction to fuzzy backend %s; " "%ud updates are still left; %ud currently pending;" " %d updates left", + ctx->worker->cf->bind_conf ? + ctx->worker->cf->bind_conf->bind_line : + "unknown", cbdata->updates_pending->len, ctx->updates_pending->len, ctx->updates_maxfail - ctx->updates_failed); @@ -511,7 +517,6 @@ rspamd_fuzzy_updates_cb (gboolean success, /* Try one more time */ rspamd_fuzzy_process_updates_queue (cbdata->ctx, cbdata->source, cbdata->final); - } } } |