diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-30 16:23:21 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-30 16:23:41 +0000 |
commit | a0584524b42a8fe196e77994c8cff0f08ad03ed3 (patch) | |
tree | 8ef38c82f69035e2e571d9b7e06501e70b1afc35 /src/plugins/lua/bayes_expiry.lua | |
parent | ecc4bc9be50ec8d71049199856d3a5eaa33be2e6 (diff) | |
download | rspamd-a0584524b42a8fe196e77994c8cff0f08ad03ed3.tar.gz rspamd-a0584524b42a8fe196e77994c8cff0f08ad03ed3.zip |
[Minor] Fix expiry config overriding
Diffstat (limited to 'src/plugins/lua/bayes_expiry.lua')
-rw-r--r-- | src/plugins/lua/bayes_expiry.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/lua/bayes_expiry.lua b/src/plugins/lua/bayes_expiry.lua index 9495cf0cd..e0bec119f 100644 --- a/src/plugins/lua/bayes_expiry.lua +++ b/src/plugins/lua/bayes_expiry.lua @@ -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 |