]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Allow to disable some modules from common redis setup
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 22 Jul 2016 16:09:19 +0000 (17:09 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 22 Jul 2016 16:22:03 +0000 (17:22 +0100)
src/lua/global_functions.lua

index 6f8576dba3c2f7ac50a76ff5389339affd30c788..0eb461496d929242c7880f046a9657c207dc32c9 100644 (file)
@@ -81,6 +81,17 @@ function rspamd_parse_redis_server(module_name)
     else
       ret = try_load_redis_servers(opts)
 
+      if opts['disabled_modules'] then
+        for _,v in ipairs(opts['disabled_modules']) do
+          if v == module_name then
+            logger.infox(rspamd_config, "NOT using default redis server for module %s: it is disabled",
+              module_name)
+
+              return nil
+          end
+        end
+      end
+
       if ret then
         logger.infox(rspamd_config, "using default redis server for module %s",
           module_name)