]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Update neural.lua
authorDmitriy Alekseev <1865999+dragoangel@users.noreply.github.com>
Wed, 21 Jan 2026 15:05:06 +0000 (16:05 +0100)
committerGitHub <noreply@github.com>
Wed, 21 Jan 2026 15:05:06 +0000 (16:05 +0100)
src/plugins/lua/neural.lua

index 2c5cd9b651e602681c92c6e6a9466281b2df92ea..98b83fa1afcd43789ec8969c10831d205443e679 100644 (file)
@@ -401,12 +401,6 @@ end
 -- * Loads spam and ham vectors
 -- * Spawn learning process
 local function do_train_ann(worker, ev_base, rule, set, ann_key)
-  -- Check if we need to train ann
-  if rule.train.store_set_only then
-    lua_util.debugm(N, rspamd_config, 'do_train_ann: skipping %s:%s key=%s due to store_set_only', rule.prefix, set.name, ann_key)
-    return
-  end
-
   local spam_elts = {}
   local ham_elts = {}
   lua_util.debugm(N, rspamd_config, 'do_train_ann: start for %s:%s key=%s', rule.prefix, set.name, ann_key)
@@ -771,6 +765,12 @@ local function maybe_train_existing_ann(worker, ev_base, rule, set, profiles)
     -- We have our ANN and that's train vectors, check if we can learn
     local ann_key = sel_elt.redis_key
 
+   -- Check if we need to train ann
+   if rule.train.store_set_only then
+     lua_util.debugm(N, rspamd_config, "skiped check if ANN %s needs to be trained due to store_set_only", ann_key)
+     return
+   end
+
     lua_util.debugm(N, rspamd_config, "check if ANN %s needs to be trained",
       ann_key)