mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
close tmp in the right place.
This commit is contained in:
parent
ea59668787
commit
56e1d90ab6
@ -377,6 +377,10 @@ class Arbiter(object):
|
||||
sys.exit(-1)
|
||||
finally:
|
||||
self.log.info("Worker %s exiting." % worker_pid)
|
||||
try:
|
||||
worker.tmp.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
def kill_workers(self, sig):
|
||||
""" kill all workers with signal sig
|
||||
@ -384,7 +388,7 @@ class Arbiter(object):
|
||||
"""
|
||||
for pid in self.WORKERS.keys():
|
||||
self.kill_worker(pid, sig)
|
||||
|
||||
|
||||
def kill_worker(self, pid, sig):
|
||||
""" kill a worker
|
||||
|
||||
@ -396,9 +400,8 @@ class Arbiter(object):
|
||||
except OSError, e:
|
||||
if e.errno == errno.ESRCH:
|
||||
worker = self.WORKERS.pop(pid)
|
||||
raise
|
||||
finally:
|
||||
try:
|
||||
worker.tmp.close()
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
worker.tmp.close()
|
||||
except:
|
||||
pass
|
||||
raise
|
||||
|
||||
@ -67,7 +67,7 @@ class UnixSocket(BaseSocket):
|
||||
return "unix:%s" % self.address
|
||||
|
||||
def create_socket(addr):
|
||||
"""\
|
||||
"""
|
||||
Create a new socket for the given address. If the
|
||||
address is a tuple, a TCP socket is created. If it
|
||||
is a string, a Unix socket is created. Otherwise
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user