mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Bug preventing HUP completion.
Just a bit of cruft from the pidfile updates.
This commit is contained in:
parent
a52a6fda17
commit
1a03c3f36e
@ -287,7 +287,7 @@ class Arbiter(object):
|
||||
Relaunch the master and workers.
|
||||
"""
|
||||
if self.pidfile is not None:
|
||||
self.pidfile.rename("%s.oldbin" % self.pidfile.path)
|
||||
self.pidfile.rename("%s.oldbin" % self.pidfile.fname)
|
||||
|
||||
self.reexec_pid = os.fork()
|
||||
if self.reexec_pid != 0:
|
||||
|
||||
@ -42,17 +42,17 @@ class Pidfile(object):
|
||||
|
||||
def rename(self, path):
|
||||
self.unlink()
|
||||
self.path = path
|
||||
self.fname = path
|
||||
self.create(self.pid)
|
||||
|
||||
def unlink(self):
|
||||
""" delete pidfile"""
|
||||
try:
|
||||
with open(self.path, "r") as f:
|
||||
with open(self.fname, "r") as f:
|
||||
pid1 = int(f.read() or 0)
|
||||
|
||||
if pid1 == self.pid:
|
||||
os.unlink(self.path)
|
||||
os.unlink(self.fname)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user