]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Improve redis params parsing
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Jun 2017 10:30:54 +0000 (11:30 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Jun 2017 10:30:54 +0000 (11:30 +0100)
lualib/lua_redis.lua

index 1b73f0e8f1c4bf39505e251092e02ec2088388f4..42a0aacefc6aef76687075951f9908158cd48a5a 100644 (file)
@@ -37,7 +37,7 @@ local function rspamd_parse_redis_server(module_name)
     end
 
     -- Store options
-    if not result['timeout'] then
+    if not result['timeout'] and not result['timeout'] == default_timeout then
       if options['timeout'] then
         result['timeout'] = tonumber(options['timeout'])
       else
@@ -48,11 +48,12 @@ local function rspamd_parse_redis_server(module_name)
     if options['prefix'] and not result['prefix'] then
       result['prefix'] = options['prefix']
     end
+
     if not result['db'] then
       if options['db'] then
-        result['db'] = options['db']
+        result['db'] = tostring(options['db'])
       elseif options['dbname'] then
-        result['db'] = options['dbname']
+        result['db'] = tostring(options['dbname'])
       end
     end
     if options['password'] and not result['password'] then