aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-08 17:44:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-08 17:44:42 +0100
commitc9aa615d7d10bf0d3690270f03a8bff431524cc2 (patch)
tree2c8db2fdb14941c71a266c68858b9ffc989ac5dc /src
parent9026da71bb262886a275a3e24b1db51ab3395240 (diff)
downloadrspamd-c9aa615d7d10bf0d3690270f03a8bff431524cc2.tar.gz
rspamd-c9aa615d7d10bf0d3690270f03a8bff431524cc2.zip
[Minor] Neural: Fix more stuff
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/neural.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua
index 0375d57cd..9ed26dafb 100644
--- a/src/plugins/lua/neural.lua
+++ b/src/plugins/lua/neural.lua
@@ -957,8 +957,8 @@ local function maybe_train_existing_ann(worker, ev_base, rule, set, profiles)
local function initiate_train()
rspamd_logger.infox(rspamd_config,
- 'need to learn ANN %s after %s learn vectors (%s required)',
- ann_key, tonumber(data), rule.train.max_trains)
+ 'need to learn ANN %s after %s required learn vectors',
+ ann_key, rule.train.max_trains)
do_train_ann(worker, ev_base, rule, set, ann_key)
end
@@ -1053,10 +1053,12 @@ local function cleanup_anns(rule, cfg, ev_base)
end
end
- lua_redis.exec_redis_script(redis_maybe_invalidate_id,
- {ev_base = ev_base, is_write = true},
- invalidate_cb,
- {set.prefix, tostring(settings.max_profiles)})
+ if type(set) == 'table' then
+ lua_redis.exec_redis_script(redis_maybe_invalidate_id,
+ {ev_base = ev_base, is_write = true},
+ invalidate_cb,
+ {set.prefix, tostring(settings.max_profiles)})
+ end
end
end