diff options
author | Paulo Villegas <paulo.vllgs@gmail.com> | 2013-12-01 00:00:41 +0100 |
---|---|---|
committer | Paulo Villegas <paulo.vllgs@gmail.com> | 2013-12-01 00:00:41 +0100 |
commit | e19a91b7895da480419faa6f9e2ad0428eff136c (patch) | |
tree | dbf7c8c9953799ad8b67d50faee24a4445164060 | |
parent | 71c64c2cfde56068f2e990bd0eca6f512c5df95f (diff) | |
download | redis-py-e19a91b7895da480419faa6f9e2ad0428eff136c.tar.gz |
self reference in SentinelConnectionPool changed to weak reference
circular reference 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 |