Browse Source

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

Justin Patrin 9 năm trước cách đây
mục cha
commit
58ee4997a5
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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