diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-31 17:03:00 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-10-31 17:03:00 +0000 |
commit | 098b9ae4891070d2951094a0324fedd835db74bb (patch) | |
tree | 8490a8214305202bc25d52f29a3c78c5e5fa4582 /src/plugins/lua | |
parent | 58fe553881315e2b8fea2ef3e37eaaea21932168 (diff) | |
download | rspamd-098b9ae4891070d2951094a0324fedd835db74bb.tar.gz rspamd-098b9ae4891070d2951094a0324fedd835db74bb.zip |
[CritFix] Fix workers scripts by sharing workers configs
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/fann_scores.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/lua/fann_scores.lua b/src/plugins/lua/fann_scores.lua index 6a63e2e6e..0d9e00435 100644 --- a/src/plugins/lua/fann_scores.lua +++ b/src/plugins/lua/fann_scores.lua @@ -559,7 +559,7 @@ else if opts['train']['max_epoch'] then max_epoch = opts['train']['max_epoch'] end - cfg:register_worker_script("log_helper", + local ret = cfg:register_worker_script("log_helper", function(score, req_score, results, cf, id, extra) -- map (snd x) (filter (fst x == module_id) extra) local extra_fann = map(function(e) return e[2] end, @@ -572,6 +572,10 @@ else opts['train'], extra_fann) end end) + + if not ret then + rspamd_logger.errx(cfg, 'cannot find worker "log_helper"') + end end) rspamd_plugins["fann_score"] = { log_callback = function(task) |