From: Vsevolod Stakhov Date: Mon, 8 Jul 2019 16:44:42 +0000 (+0100) Subject: [Minor] Neural: Fix more stuff X-Git-Tag: 2.0~630 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9aa615d7d10bf0d3690270f03a8bff431524cc2;p=thirdparty%2Frspamd.git [Minor] Neural: Fix more stuff --- diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua index 0375d57cdc..9ed26dafb0 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