MCPcopy
hub / github.com/benoitc/gunicorn / maybe_promote_master

Method maybe_promote_master

gunicorn/arbiter.py:352–367  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

350 self.log.debug("SIGWINCH ignored. Not daemonized")
351
352 def maybe_promote_master(self):
353 if self.master_pid == 0:
354 return
355
356 if self.master_pid != os.getppid():
357 self.log.info("Master has been promoted.")
358 # reset master infos
359 self.master_name = "Master"
360 self.master_pid = 0
361 self.proc_name = self.cfg.proc_name
362 del os.environ['GUNICORN_PID']
363 # rename the pidfile
364 if self.pidfile is not None:
365 self.pidfile.rename(self.cfg.pidfile)
366 # reset proctitle
367 util._setproctitle("master [%s]" % self.proc_name)
368
369 def wakeup(self):
370 """Wake up the arbiter's main loop."""

Callers 1

runMethod · 0.95

Calls 2

renameMethod · 0.80
infoMethod · 0.45

Tested by

no test coverage detected