mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-08 13:41:31 +08:00
fix issue #24.
This commit is contained in:
parent
6170d5a503
commit
368257a733
@ -352,9 +352,13 @@ class Arbiter(object):
|
|||||||
Kill unused/idle workers
|
Kill unused/idle workers
|
||||||
"""
|
"""
|
||||||
for (pid, worker) in list(self.WORKERS.items()):
|
for (pid, worker) in list(self.WORKERS.items()):
|
||||||
|
try:
|
||||||
diff = time.time() - os.fstat(worker.tmp.fileno()).st_ctime
|
diff = time.time() - os.fstat(worker.tmp.fileno()).st_ctime
|
||||||
if diff <= self.timeout:
|
if diff <= self.timeout:
|
||||||
continue
|
continue
|
||||||
|
except ValueError:
|
||||||
|
continue
|
||||||
|
|
||||||
self.log.error("Worker timed out: %s (pid:%s)" % (worker, pid))
|
self.log.error("Worker timed out: %s (pid:%s)" % (worker, pid))
|
||||||
self.kill_worker(pid, signal.SIGKILL)
|
self.kill_worker(pid, signal.SIGKILL)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user