Skip to content

Commit

Permalink
self reference in SentinelConnectionPool changed to weak reference
Browse files Browse the repository at this point in the history
circular reference changed to weak reference to enable garbage collection
  • Loading branch information
paulovn committed Nov 30, 2013
1 parent 71c64c2 commit e19a91b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion redis/sentinel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import random
import weakref

from redis.client import StrictRedis
from redis.connection import ConnectionPool, Connection
Expand Down Expand Up @@ -56,7 +57,7 @@ def __init__(self, service_name, sentinel_manager, **kwargs):
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
Expand Down

0 comments on commit e19a91b

Please sign in to comment.