@@ -335,10 +335,13 @@ def master_for(
335
335
kwargs ["is_master" ] = True
336
336
connection_kwargs = dict (self .connection_kwargs )
337
337
connection_kwargs .update (kwargs )
338
+
339
+ connection_pool = connection_pool_class (service_name , self , ** connection_kwargs )
340
+ # The Redis object "owns" the pool
341
+ auto_close_connection_pool = True
338
342
return redis_class (
339
- connection_pool = connection_pool_class (
340
- service_name , self , ** connection_kwargs
341
- )
343
+ connection_pool = connection_pool ,
344
+ auto_close_connection_pool = auto_close_connection_pool ,
342
345
)
343
346
344
347
def slave_for (
@@ -368,8 +371,11 @@ def slave_for(
368
371
kwargs ["is_master" ] = False
369
372
connection_kwargs = dict (self .connection_kwargs )
370
373
connection_kwargs .update (kwargs )
374
+
375
+ connection_pool = connection_pool_class (service_name , self , ** connection_kwargs )
376
+ # The Redis object "owns" the pool
377
+ auto_close_connection_pool = True
371
378
return redis_class (
372
- connection_pool = connection_pool_class (
373
- service_name , self , ** connection_kwargs
374
- )
379
+ connection_pool = connection_pool ,
380
+ auto_close_connection_pool = auto_close_connection_pool ,
375
381
)
0 commit comments