summaryrefslogtreecommitdiffstats
path: root/src/libstat/stat_process.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-10 00:36:03 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-10 00:36:03 +0100
commitf4d576701c8fd2a8ea7512fa7dea70ae9f3dff2d (patch)
tree926173dfa3f4443921518d45c408f88088d5808a /src/libstat/stat_process.c
parent9c19146f9b903aa0d1323faf58d920897ec61f72 (diff)
downloadrspamd-f4d576701c8fd2a8ea7512fa7dea70ae9f3dff2d.tar.gz
rspamd-f4d576701c8fd2a8ea7512fa7dea70ae9f3dff2d.zip
Add finalize process operation.
We could use sqlite transaction for reading as well.
Diffstat (limited to 'src/libstat/stat_process.c')
-rw-r--r--src/libstat/stat_process.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libstat/stat_process.c b/src/libstat/stat_process.c
index 978264ac4..9c261eccd 100644
--- a/src/libstat/stat_process.c
+++ b/src/libstat/stat_process.c
@@ -356,11 +356,12 @@ rspamd_stat_classify (struct rspamd_task *task, lua_State *L, GError **err)
struct rspamd_stat_classifier *cls;
struct rspamd_classifier_config *clcf;
struct rspamd_stat_ctx *st_ctx;
+ struct rspamd_statfile_runtime *st_run;
struct rspamd_tokenizer_runtime *tklist = NULL, *tok;
struct rspamd_classifier_runtime *cl_run;
struct classifier_ctx *cl_ctx;
GList *cl_runtimes;
- GList *cur;
+ GList *cur, *curst;
gboolean ret = RSPAMD_STAT_PROCESS_ERROR, compat = TRUE;
const ucl_object_t *obj;
@@ -440,6 +441,16 @@ rspamd_stat_classify (struct rspamd_task *task, lua_State *L, GError **err)
}
}
+ curst = cl_run->st_runtime;
+
+ while (curst) {
+ st_run = curst->data;
+ st_run->backend->finalize_learn (task,
+ st_run->backend_runtime,
+ st_run->backend->ctx);
+ curst = g_list_next (curst);
+ }
+
cur = g_list_next (cur);
}