ソースを参照

[Minor] Fix expiry config overriding

tags/1.8.2
Vsevolod Stakhov 5年前
コミット
a0584524b4
1個のファイルの変更5行の追加1行の削除
  1. 5
    1
      src/plugins/lua/bayes_expiry.lua

+ 5
- 1
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

読み込み中…
キャンセル
保存