commit c9aa615: [Minor] Neural: Fix more stuff
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Jul 8 16:49:06 UTC 2019
Author: Vsevolod Stakhov
Date: 2019-07-08 17:44:42 +0100
URL: https://github.com/rspamd/rspamd/commit/c9aa615d7d10bf0d3690270f03a8bff431524cc2 (HEAD -> master)
[Minor] Neural: Fix more stuff
---
src/plugins/lua/neural.lua | 14 ++++++++------
1 file 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
More information about the Commits
mailing list