mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
some changes after review of @davisp
This commit is contained in:
parent
fd4e13511d
commit
c3801b5283
@ -157,6 +157,7 @@ class Arbiter(object):
|
||||
self.log.info("Listen on %s:%s" % self.LISTENER.getsockname())
|
||||
except TypeError:
|
||||
self.log.info("Listen on %s" % self.LISTENER.getsockname())
|
||||
|
||||
def init_socket_fromfd(self, fd, address):
|
||||
if isinstance(address, basestring):
|
||||
sock = socket.fromfd(fd, socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
|
||||
@ -14,7 +14,7 @@ import sys
|
||||
from gunicorn.arbiter import Arbiter
|
||||
from gunicorn import util
|
||||
|
||||
__usage__ = "%prog [OPTIONS]"
|
||||
__usage__ = "%prog [OPTIONS] [APP_MODULE]"
|
||||
|
||||
LOG_LEVELS = {
|
||||
"critical": logging.CRITICAL,
|
||||
@ -113,8 +113,7 @@ def main(usage, get_app):
|
||||
pidfile=opts.pidfile
|
||||
)
|
||||
|
||||
arbiter = Arbiter(addr, workers, app,
|
||||
**kwargs)
|
||||
arbiter = Arbiter(addr, workers, app, **kwargs)
|
||||
if opts.daemon:
|
||||
daemonize()
|
||||
else:
|
||||
|
||||
@ -27,8 +27,7 @@ class Worker(object):
|
||||
|
||||
PIPE = []
|
||||
|
||||
def __init__(self, workerid, ppid, socket, app, timeout,
|
||||
debug=False):
|
||||
def __init__(self, workerid, ppid, socket, app, timeout, debug=False):
|
||||
self.nr = 0
|
||||
self.id = workerid
|
||||
self.ppid = ppid
|
||||
@ -108,12 +107,11 @@ class Worker(object):
|
||||
except socket.error, e:
|
||||
if e[0] not in (errno.EAGAIN, errno.ECONNABORTED):
|
||||
raise
|
||||
if self.nr < 0: break
|
||||
|
||||
# Keep processing clients until no one is waiting.
|
||||
# This prevents the need to select() for every
|
||||
# client that we process.
|
||||
if self.nr != 0:
|
||||
if self.nr > 0:
|
||||
continue
|
||||
|
||||
# If our parent changed then we shut down.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user