Merge pull request #817 from benoitc/816-gthread-keepalive-pop

Fix major issue with threaded worker keepalive
This commit is contained in:
Benoit Chesneau 2014-07-13 06:25:26 +02:00
commit 1584023731

View File

@ -134,18 +134,17 @@ class ThreadWorker(base.Worker):
now = time.time()
while True:
try:
# remove the connection from the queue
conn = self._keep.popleft()
except IndexError:
break
delta = conn.timeout - now
if delta > 0:
# add the connection back to the queue
self._keep.appendleft(conn)
break
else:
# remove the connection from the queue
conn = self._keep.popleft()
# remove the socket from the poller
self.poller.unregister(conn.sock)