diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-25 13:46:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-09-25 13:46:42 +0100 |
commit | 8dc04e1bf4d48dd5af65590455deac338cf67f6c (patch) | |
tree | fef6b2cd689d202b60819c85a6ce3c0e64d6288e | |
parent | 00607a4168ebb1e46a23ea8a9cfb357fd7e26a5d (diff) | |
download | rspamd-8dc04e1bf4d48dd5af65590455deac338cf67f6c.tar.gz rspamd-8dc04e1bf4d48dd5af65590455deac338cf67f6c.zip |
Save learned messages count.
-rw-r--r-- | src/controller.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/controller.c b/src/controller.c index f5d7e7637..4fcc72996 100644 --- a/src/controller.c +++ b/src/controller.c @@ -2110,6 +2110,12 @@ rspamd_controller_load_saved_stats (struct rspamd_controller_worker_ctx *ctx) stat_copy.messages_scanned = ucl_object_toint (elt); } + elt = ucl_object_find_key (obj, "learned"); + + if (elt != NULL && ucl_object_type (elt) == UCL_INT) { + stat_copy.messages_learned = ucl_object_toint (elt); + } + elt = ucl_object_find_key (obj, "actions"); if (elt != NULL) { @@ -2204,6 +2210,8 @@ rspamd_controller_store_saved_stats (struct rspamd_controller_worker_ctx *ctx) top = ucl_object_typed_new (UCL_OBJECT); ucl_object_insert_key (top, ucl_object_fromint ( stat->messages_scanned), "scanned", 0, false); + ucl_object_insert_key (top, ucl_object_fromint ( + stat->messages_learned), "learned", 0, false); if (stat->messages_scanned > 0) { sub = ucl_object_typed_new (UCL_OBJECT); |