浏览代码

Adding support for the `BROKER_BACKEND_EXTRA_ARGS` configuration option, an optional dict() which can be used to pass connection arguments to alternative broker implementations (like `sqlakombu`).

Ryan Petrello 14 年之前
父节点
当前提交
d860590da8
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 1
      celery/app/base.py
  2. 1 0
      celery/app/defaults.py

+ 2 - 1
celery/app/base.py

@@ -167,7 +167,8 @@ class BaseApp(object):
                     insist=self.either("BROKER_INSIST", insist),
                     ssl=self.either("BROKER_USE_SSL", ssl),
                     connect_timeout=self.either(
-                                "BROKER_CONNECTION_TIMEOUT", connect_timeout))
+                                "BROKER_CONNECTION_TIMEOUT", connect_timeout),
+                    backend_extra_args=self.conf.BROKER_BACKEND_EXTRA_ARGS)
 
     def with_default_connection(self, fun):
         """With any function accepting `connection` and `connect_timeout`

+ 1 - 0
celery/app/defaults.py

@@ -52,6 +52,7 @@ NAMESPACES = {
         "CONNECTION_MAX_RETRIES": Option(100, type="int"),
         "INSIST": Option(False, type="bool"),
         "USE_SSL": Option(False, type="bool"),
+        "BACKEND_EXTRA_ARGS": Option({}, type="dict")
     },
     "CELERY": {
         "ACKS_LATE": Option(False, type="bool"),