commit db6658e: [Minor] rspamadm clickhouse neural_train : avoid UCL parser re-use

Andrew Lewis nerf at judo.za.org
Wed Apr 21 09:00:04 UTC 2021


Author: Andrew Lewis
Date: 2021-04-21 10:51:41 +0200
URL: https://github.com/rspamd/rspamd/commit/db6658e9ac8352bf43261b8e7f69200cd667bdb6 (refs/pull/3725/head)

[Minor] rspamadm clickhouse neural_train : avoid UCL parser re-use

---
 lualib/rspamadm/clickhouse.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lualib/rspamadm/clickhouse.lua b/lualib/rspamadm/clickhouse.lua
index f0faff9aa..7f215f6aa 100644
--- a/lualib/rspamadm/clickhouse.lua
+++ b/lualib/rspamadm/clickhouse.lua
@@ -375,7 +375,6 @@ local function handle_neural_train(args)
   local this_where -- which class of messages are we collecting data for
   local ham_rows, spam_rows = {}, {}
   local want_spam, want_ham = true, true -- keep collecting while true
-  local ucl_parser = ucl.parser()
 
   -- Try find profile in config
   local neural_opts = rspamd_config:get_all_opt('neural')
@@ -403,6 +402,7 @@ local function handle_neural_train(args)
         return
       end
     end
+    local ucl_parser = ucl.parser()
     local ok, err = ucl_parser:parse_string(r[args.column_name_vector], 'msgpack')
     if not ok then
       io.stderr:write(string.format("Couldn't parse [%s]: %s", r[args.column_name_vector], err))


More information about the Commits mailing list