]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix expiry config overriding
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 30 Oct 2018 16:23:21 +0000 (16:23 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 30 Oct 2018 16:23:41 +0000 (16:23 +0000)
src/plugins/lua/bayes_expiry.lua

index 9495cf0cd175aaaec64c3a35cf8e2449200b209a..e0bec119feefb303732d94ef9d2161b3fb240bb2 100644 (file)
@@ -44,6 +44,10 @@ local function check_redis_classifier(cls, cfg)
   if cls.new_schema then
     local symbol_spam, symbol_ham
     local expiry = (cls.expiry or cls.expire)
+    if type(expiry) == 'table' then
+      expiry = expiry[1]
+    end
+
     if cls.lazy then settings.lazy = cls.lazy end
     -- Load symbols from statfiles
     local statfiles = cls.statfile
@@ -68,7 +72,7 @@ local function check_redis_classifier(cls, cfg)
       end
     end
 
-    if not symbol_spam or not symbol_ham or not expiry then
+    if not symbol_spam or not symbol_ham or not type(expiry) == 'number' then
       return
     end
     -- Now try to load redis_params if needed