From 992fb2a043ac340615ce14cc459a9bfbabd4d1d5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 21 Feb 2017 16:32:41 +0000 Subject: [PATCH] [Minor] Fix ANN learn condition --- src/plugins/lua/fann_redis.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/lua/fann_redis.lua b/src/plugins/lua/fann_redis.lua index a0953b00c..f57a43466 100644 --- a/src/plugins/lua/fann_redis.lua +++ b/src/plugins/lua/fann_redis.lua @@ -780,7 +780,7 @@ local function maybe_train_fanns(cfg, ev_base) if _err then rspamd_logger.errx(rspamd_config, 'cannot get FANN trains %s from redis: %s', prefix, _err) elseif _data and type(_data) == 'number' or type(_data) == 'string' then - if tonumber(_data) and tonumber(_data) > max_trains then + if tonumber(_data) and tonumber(_data) >= max_trains then rspamd_logger.infox(rspamd_config, 'need to learn ANN %s after %s learn vectors (%s required)', prefix, tonumber(_data), max_trains) train_fann(cfg, ev_base, elt) -- 2.39.5