mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
while we are here just parse all the address in the conf file. so we
could have unix socket support in paster app too by just passing the host
This commit is contained in:
parent
7036e424bb
commit
d00712da2e
@ -112,10 +112,7 @@ def main(usage, get_app):
|
||||
workers = 1
|
||||
|
||||
bind = opts.bind or '127.0.0.1'
|
||||
if bind.startswith("unix:"):
|
||||
addr = bind.split("unix:")[1]
|
||||
else:
|
||||
addr = util.parse_address(bind)
|
||||
addr = util.parse_address(bind)
|
||||
|
||||
umask = int(opts.umask or UMASK)
|
||||
|
||||
|
||||
@ -47,10 +47,7 @@ class Command(BaseCommand):
|
||||
raise CommandError('Usage is runserver %s' % self.args)
|
||||
|
||||
bind = addrport or '127.0.0.1'
|
||||
if bind.startswith("unix:"):
|
||||
addr = bind.split("unix:")[1]
|
||||
else:
|
||||
addr = parse_address(bind)
|
||||
addr = parse_address(bind)
|
||||
|
||||
admin_media_path = options.get('admin_media_path', '')
|
||||
workers = int(options.get('workers', '1'))
|
||||
|
||||
@ -31,6 +31,9 @@ monthname = [None,
|
||||
|
||||
|
||||
def parse_address(host, port=None, default_port=8000):
|
||||
if host.startswith("unix:"):
|
||||
return host.split("unix:")[1]
|
||||
|
||||
if not port:
|
||||
if ':' in host:
|
||||
host, port = host.split(':', 1)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user