]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Another fix to symbols change in fann_redis
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Nov 2016 12:13:15 +0000 (12:13 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 22 Nov 2016 12:13:31 +0000 (12:13 +0000)
src/plugins/lua/fann_redis.lua

index 1cdda8bef741858551f8b17bf44a979d19e08838..49aeb113c0f544da4e593ab2ec5a62f321f8bd94 100644 (file)
@@ -500,7 +500,8 @@ local function train_fann(_, ev_base, elt)
 
       -- Now we can train fann
       local n = rspamd_config:get_symbols_count() + rspamd_count_metatokens()
-      if not fanns[elt] or not fanns[elt].fann_train then
+      if not fanns[elt] or not fanns[elt].fann_train
+        or n ~= fanns[elt].fann_train:get_inputs() then
         -- Create fann if it does not exist
         create_train_fann(n, elt)
       end