summaryrefslogtreecommitdiffstats
path: root/lualib/global_functions.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-19 16:12:57 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-19 16:12:57 +0100
commitf7054dc0b595e3ed714a5d859c049672aa2eba08 (patch)
tree10cbe3c8f2e6ce722ecf8d6f20289f6518312eab /lualib/global_functions.lua
parentc5f4b41eee597cafc0aafdd828b5750b3fa49928 (diff)
downloadrspamd-f7054dc0b595e3ed714a5d859c049672aa2eba08.tar.gz
rspamd-f7054dc0b595e3ed714a5d859c049672aa2eba08.zip
[Fix] Fix Redis timeout set
Issue: #1646
Diffstat (limited to 'lualib/global_functions.lua')
-rw-r--r--lualib/global_functions.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/lualib/global_functions.lua b/lualib/global_functions.lua
index 17c8f11ea..4447f85ef 100644
--- a/lualib/global_functions.lua
+++ b/lualib/global_functions.lua
@@ -38,11 +38,13 @@ local function rspamd_parse_redis_server(module_name)
-- Store options
if not result['timeout'] then
- result['timeout'] = default_timeout
- end
- if options['timeout'] and not result['timeout'] then
- result['timeout'] = tonumber(options['timeout'])
+ if options['timeout'] then
+ result['timeout'] = tonumber(options['timeout'])
+ else
+ result['timeout'] = default_timeout
+ end
end
+
if options['prefix'] and not result['prefix'] then
result['prefix'] = options['prefix']
end