Skip to content

Commit

Permalink
Fixed reconnect=False, broken by 5469ca1
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaSkriblovsky committed Jan 12, 2016
1 parent a58a716 commit 9e319fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion txredisapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,7 @@ def __init__(self, factory):

def disconnect(self):
self._factory.continueTrying = 0
self._factory.disconnectCalled = True
for conn in self._factory.pool:
try:
conn.transport.loseConnection()
Expand Down Expand Up @@ -2133,6 +2134,7 @@ def __init__(self, uuid, dbid, poolsize, isLazy=False,
self.handler = handler(self)
self.connectionQueue = defer.DeferredQueue()
self._waitingForEmptyPool = set()
self.disconnectCalled = False

def buildProtocol(self, addr):
if hasattr(self, 'charset'):
Expand All @@ -2144,7 +2146,7 @@ def buildProtocol(self, addr):
return p

def addConnection(self, conn):
if not self.continueTrying:
if self.disconnectCalled:
conn.transport.loseConnection()
return

Expand Down

0 comments on commit 9e319fa

Please sign in to comment.