mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
some fixes.
This commit is contained in:
parent
7dc51eb92b
commit
6497d5aab2
@ -142,7 +142,16 @@ def main(usage, get_app):
|
|||||||
parser.set_defaults(**default_options)
|
parser.set_defaults(**default_options)
|
||||||
opts, args = parser.parse_args()
|
opts, args = parser.parse_args()
|
||||||
|
|
||||||
fileopts = get_config(opts.config) or {}
|
|
||||||
|
if opts.config:
|
||||||
|
conf_file = opts.config
|
||||||
|
else:
|
||||||
|
conf_file = os.path.join(os.getcwd(), "gunicorn.conf.py")
|
||||||
|
|
||||||
|
if os.path.isfile(conf_file):
|
||||||
|
fileopts = get_config(conf_file) or {}
|
||||||
|
else:
|
||||||
|
fileopts = {}
|
||||||
|
|
||||||
# optparse returns object, we want a dict
|
# optparse returns object, we want a dict
|
||||||
opts = opts.__dict__
|
opts = opts.__dict__
|
||||||
@ -171,13 +180,13 @@ def main(usage, get_app):
|
|||||||
pidfile=config['pidfile']
|
pidfile=config['pidfile']
|
||||||
)
|
)
|
||||||
|
|
||||||
arbiter = Arbiter(addr, workers, app, args[0], **kwargs)
|
arbiter = Arbiter(addr, workers, app, **kwargs)
|
||||||
if config['daemon']:
|
if config['daemon']:
|
||||||
daemonize(umask)
|
daemonize(umask)
|
||||||
else:
|
else:
|
||||||
os.setpgrp()
|
os.setpgrp()
|
||||||
|
|
||||||
set_owner_process(opts.user, opts.group)
|
set_owner_process(config['user'], config['group'])
|
||||||
configure_logging(config)
|
configure_logging(config)
|
||||||
arbiter.run()
|
arbiter.run()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user