Browse Source

Support redis timeout paramaters in the URL. They need to be float to work.

Justin Patrin 9 years ago
parent
commit
1974371d0a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      celery/backends/redis.py

+ 4 - 0
celery/backends/redis.py

@@ -130,6 +130,10 @@ class RedisBackend(KeyValueStoreBackend):
         db = db.strip('/') if isinstance(db, string_t) else db
         connparams['db'] = int(db)
 
+        for key in ['socket_timeout', 'socket_connect_timeout']:
+            if key in query:
+                query[key] = float(query[key])
+
         # Query parameters override other parameters
         connparams.update(query)
         return connparams