mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix race keepalived condition by popping/appending from left
This commit is contained in:
parent
3cda90a214
commit
abac771c44
@ -120,11 +120,13 @@ class ThreadWorker(base.Worker):
|
||||
now = time.time()
|
||||
while True:
|
||||
try:
|
||||
delta = self._keep[0].timeout - now
|
||||
conn = self._keep.popleft()
|
||||
except IndexError:
|
||||
break
|
||||
|
||||
delta = conn.timeout - now
|
||||
if delta > 0:
|
||||
self._keep.appendleft(conn)
|
||||
break
|
||||
else:
|
||||
# remove the connection from the queue
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user