Browse Source

Redis result backend: Adds missing max_connections class attribute

Ask Solem 13 years ago
parent
commit
9eeec59edb
1 changed files with 6 additions and 2 deletions
  1. 6 2
      celery/backends/redis.py

+ 6 - 2
celery/backends/redis.py

@@ -32,6 +32,9 @@ class RedisBackend(KeyValueStoreBackend):
     #: default Redis password (:const:`None`)
     password = None
 
+    #: Maximium number of connections in the pool.
+    max_connections = None
+
     supports_native_join = True
 
     def __init__(self, host=None, port=None, db=None, password=None,
@@ -56,8 +59,9 @@ class RedisBackend(KeyValueStoreBackend):
         self.db = db or _get("DB") or self.db
         self.password = password or _get("PASSWORD") or self.password
         self.expires = self.prepare_expires(expires, type=int)
-        self.max_connections = max_connections or _get("MAX_CONNECTIONS") \
-                               or self.max_connections
+        self.max_connections = (max_connections
+                                or _get("MAX_CONNECTIONS")
+                                or self.max_connections)
     def get(self, key):
         return self.client.get(key)