mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Merge pull request #1273 from wipply/pre-exec-environment
Allow to modify environment in pre_exec callback
This commit is contained in:
commit
df55657282
@ -399,13 +399,14 @@ class Arbiter(object):
|
||||
if self.reexec_pid != 0:
|
||||
return
|
||||
|
||||
self.cfg.pre_exec(self)
|
||||
|
||||
environ = self.cfg.env_orig.copy()
|
||||
fds = [l.fileno() for l in self.LISTENERS]
|
||||
environ['GUNICORN_FD'] = ",".join([str(fd) for fd in fds])
|
||||
environ['GUNICORN_PID'] = str(master_pid)
|
||||
|
||||
os.chdir(self.START_CTX['cwd'])
|
||||
self.cfg.pre_exec(self)
|
||||
|
||||
# exec the process using the original environnement
|
||||
os.execvpe(self.START_CTX[0], self.START_CTX['args'], environ)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user