File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,10 @@ def str_to_class(s):
4242
4343class ResQ (object ):
4444
45- def __init__ (self , server = "localhost:6379" , password = None ):
45+ def __init__ (self , server = "localhost:6379" , password = None ,
46+ timeout = None , retry_connection = True ):
47+ self .timeout = timeout
48+ self .retry_connection = retry_connection
4649 self .redis = server
4750 if password :
4851 self .redis .auth (password )
@@ -85,7 +88,9 @@ def _set_redis(self, server):
8588 if isinstance (server , basestring ):
8689 self .dsn = server
8790 host , port = server .split (':' )
88- self ._redis = Redis (host = host , port = int (port ))
91+ self ._redis = Redis (host = host , port = int (port ),
92+ retry_connection = self .retry_connection ,
93+ timeout = self .timeout )
8994 elif isinstance (server , Redis ):
9095 self .dsn = '%s:%s' % (server .host ,server .port )
9196 self ._redis = server
You can’t perform that action at this time.
0 commit comments