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()
|
now = time.time()
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
delta = self._keep[0].timeout - now
|
conn = self._keep.popleft()
|
||||||
except IndexError:
|
except IndexError:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
delta = conn.timeout - now
|
||||||
if delta > 0:
|
if delta > 0:
|
||||||
|
self._keep.appendleft(conn)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# remove the connection from the queue
|
# remove the connection from the queue
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user