From e19a91b7895da480419faa6f9e2ad0428eff136c Mon Sep 17 00:00:00 2001 From: Paulo Villegas Date: Sun, 1 Dec 2013 00:00:41 +0100 Subject: self reference in SentinelConnectionPool changed to weak reference circular reference changed to weak reference to enable garbage collection --- redis/sentinel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'redis/sentinel.py') diff --git a/redis/sentinel.py b/redis/sentinel.py index 8ba9920..e124f29 100644 --- a/redis/sentinel.py +++ b/redis/sentinel.py @@ -1,5 +1,6 @@ import os import random +import weakref from redis.client import StrictRedis from redis.connection import ConnectionPool, Connection @@ -56,7 +57,7 @@ class SentinelConnectionPool(ConnectionPool): self.is_master = kwargs.pop('is_master', True) self.check_connection = kwargs.pop('check_connection', False) super(SentinelConnectionPool, self).__init__(**kwargs) - self.connection_kwargs['connection_pool'] = self + self.connection_kwargs['connection_pool'] = weakref.proxy(self) self.service_name = service_name self.sentinel_manager = sentinel_manager self.master_address = None -- cgit v1.2.1