diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2013-12-10 10:36:18 -0800 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2013-12-10 10:36:18 -0800 |
commit | e091c88bb81c5bdeb2da0ff36bb53763c8559984 (patch) | |
tree | 8b9bf4fa8c5619f43a2a3c6fa5e8700448f321ee | |
parent | 81a4a31779af0a608dcd04bfc3d33995aaa87272 (diff) | |
parent | e19a91b7895da480419faa6f9e2ad0428eff136c (diff) | |
download | redis-py-e091c88bb81c5bdeb2da0ff36bb53763c8559984.tar.gz |
Merge pull request #409 from paulovn/master
Circular reference in SentinelConnectionPool changed to weak reference, to enable garbage collection
-rw-r--r-- | redis/sentinel.py | 3 |
1 files changed, 2 insertions, 1 deletions
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 |