mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
simplify the code
This commit is contained in:
parent
d6012fa84b
commit
961eabb332
@ -21,5 +21,6 @@ def app(environ, start_response):
|
|||||||
('Content-Length', str(len(data))),
|
('Content-Length', str(len(data))),
|
||||||
('X-Gunicorn-Version', __version__)
|
('X-Gunicorn-Version', __version__)
|
||||||
]
|
]
|
||||||
|
|
||||||
start_response(status, response_headers)
|
start_response(status, response_headers)
|
||||||
return iter([data])
|
return iter([data])
|
||||||
|
|||||||
@ -107,9 +107,7 @@ class Logger(object):
|
|||||||
if cfg.errorlog != "-":
|
if cfg.errorlog != "-":
|
||||||
# if an error log file is set redirect stdout & stderr to
|
# if an error log file is set redirect stdout & stderr to
|
||||||
# this log file.
|
# this log file.
|
||||||
stdout_log = LazyWriter(cfg.errorlog, 'a')
|
sys.stdout = sys.stderr = LazyWriter(cfg.errorlog, 'a')
|
||||||
sys.stdout = stdout_log
|
|
||||||
sys.stderr = stdout_log
|
|
||||||
|
|
||||||
# set gunicorn.error handler
|
# set gunicorn.error handler
|
||||||
self._set_handler(self.error_log, cfg.errorlog,
|
self._set_handler(self.error_log, cfg.errorlog,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user