]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Neural] Add option to skip training if store_set_only is true
authorDmitriy Alekseev <1865999+dragoangel@users.noreply.github.com>
Fri, 9 Jan 2026 19:23:47 +0000 (20:23 +0100)
committerGitHub <noreply@github.com>
Fri, 9 Jan 2026 19:23:47 +0000 (20:23 +0100)
src/plugins/lua/neural.lua

index 8d9859f8a9a0ac0e882221b7bd8d3dc4c7f20eef..f158e035ff3bfaf8c1896decb05ce1b9f18b4da0 100644 (file)
@@ -401,6 +401,12 @@ 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 set.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)