mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
only get last update of the worker once when checking oldest
spotted by @tilgovi, a race condition is possible when making 2 consecutive calls to the last_update function, so only get it once.
This commit is contained in:
parent
4fe426cd66
commit
34eb1b63f9
@ -309,8 +309,9 @@ class Arbiter(object):
|
||||
oldest = time.time()
|
||||
for w in worker_values:
|
||||
try:
|
||||
if w.tmp.last_update() < oldest:
|
||||
oldest = w.tmp.last_update()
|
||||
last_update = w.tmp.last_update()
|
||||
if last_update < oldest:
|
||||
oldest = last_update
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user