mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Merge pull request #817 from benoitc/816-gthread-keepalive-pop
Fix major issue with threaded worker keepalive
This commit is contained in:
commit
1584023731
@ -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)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user