mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
revert previous change
This commit is contained in:
parent
d21254edfc
commit
562c9a2d70
21
examples/gunicorn.conf.py.sample
Normal file
21
examples/gunicorn.conf.py.sample
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
nd='unix:/tmp/gunicorn.sock',
|
||||||
|
daemon=True,
|
||||||
|
debug=False,
|
||||||
|
logfile='/var/log/gunicorn.log',
|
||||||
|
loglevel='info',
|
||||||
|
pidfile='/var/run/gunicorn.pid',
|
||||||
|
workers=1,
|
||||||
|
umask=0,
|
||||||
|
|
||||||
|
# for systems with nobody and no group
|
||||||
|
user="nobody",
|
||||||
|
group="nogroup",
|
||||||
|
|
||||||
|
after_fork=lambda server, worker: server.log.info(
|
||||||
|
"worker=%s spawned pid=%s" % (worker.id,
|
||||||
|
str(worker.pid))),
|
||||||
|
|
||||||
|
before_fork=lambda server, worker: server.log.info(
|
||||||
|
"worker=%s spawning" % worker.id),
|
||||||
|
|
||||||
|
before_exec=lambda server: server.log.info("forked child, reexecuting")
|
||||||
@ -74,8 +74,6 @@ class Request(object):
|
|||||||
|
|
||||||
self.log.debug("%s", self.parser.status)
|
self.log.debug("%s", self.parser.status)
|
||||||
self.log.debug("Headers:\n%s" % headers)
|
self.log.debug("Headers:\n%s" % headers)
|
||||||
if not headers:
|
|
||||||
return
|
|
||||||
|
|
||||||
if self.parser.headers_dict.get('Expect','').lower() == "100-continue":
|
if self.parser.headers_dict.get('Expect','').lower() == "100-continue":
|
||||||
self._sock.send("HTTP/1.1 100 Continue\r\n\r\n")
|
self._sock.send("HTTP/1.1 100 Continue\r\n\r\n")
|
||||||
|
|||||||
@ -33,10 +33,11 @@ class BaseSocket(object):
|
|||||||
|
|
||||||
def set_options(self, sock, bound=False):
|
def set_options(self, sock, bound=False):
|
||||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||||
sock.setblocking(0)
|
|
||||||
if not bound:
|
if not bound:
|
||||||
self.bind(sock)
|
self.bind(sock)
|
||||||
|
sock.setblocking(0)
|
||||||
sock.listen(self.conf['backlog'])
|
sock.listen(self.conf['backlog'])
|
||||||
|
|
||||||
return sock
|
return sock
|
||||||
|
|
||||||
def bind(self, sock):
|
def bind(self, sock):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user