summaryrefslogtreecommitdiffstats
path: root/lualib/lua_redis.lua
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-06-10 15:45:29 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-06-10 15:45:29 +0200
commitc30cfcb21a5d1b2fa14944ff3633198a95ea3c2d (patch)
treea947837bbd92ed3bdf4a22b54dd6b492e9500246 /lualib/lua_redis.lua
parentcd0cc6187ed4b153e3506bbf79d28aa760a85f4a (diff)
downloadrspamd-c30cfcb21a5d1b2fa14944ff3633198a95ea3c2d.tar.gz
rspamd-c30cfcb21a5d1b2fa14944ff3633198a95ea3c2d.zip
[Feature] Bayes expiry plugin
Diffstat (limited to 'lualib/lua_redis.lua')
-rw-r--r--lualib/lua_redis.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/lualib/lua_redis.lua b/lualib/lua_redis.lua
index 42a0aacef..0dc5872fe 100644
--- a/lualib/lua_redis.lua
+++ b/lualib/lua_redis.lua
@@ -5,7 +5,7 @@ local exports = {}
-- This function parses redis server definition using either
-- specific server string for this module or global
-- redis section
-local function rspamd_parse_redis_server(module_name)
+local function rspamd_parse_redis_server(module_name, module_opts, no_fallback)
local result = {}
local default_port = 6379
@@ -71,7 +71,12 @@ local function rspamd_parse_redis_server(module_name)
end
-- Try local options
- local opts = rspamd_config:get_all_opt(module_name)
+ local opts
+ if not module_opts then
+ opts = rspamd_config:get_all_opt(module_name)
+ else
+ opts = module_opts
+ end
local ret = false
if opts then
@@ -82,6 +87,8 @@ local function rspamd_parse_redis_server(module_name)
return result
end
+ if no_fallback then return nil end
+
-- Try global options
opts = rspamd_config:get_all_opt('redis')