Fix calling condition for Arbiter.log.reopen_files()

`GUNICORN_FD` is not always set in a `reexec`ed child process.
Considering `Arbiter.master_pid` is set after log reopening,
choose `GUNICORN_PID`.
This commit is contained in:
laggardkernel 2021-04-08 14:14:45 +08:00
parent cf55d2cec2
commit 7d50d61f94

View File

@ -93,7 +93,7 @@ class Arbiter(object):
self.log = self.cfg.logger_class(app.cfg)
# reopen files
if 'GUNICORN_FD' in os.environ:
if 'GUNICORN_PID' in os.environ:
self.log.reopen_files()
self.worker_class = self.cfg.worker_class