mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
imahe gevent_sgi and alias of gevent_pywsgi
wgsi gevent is now an alias of pywsgi in future 1.0 so slowly deprecate it.
This commit is contained in:
parent
1947e2b26e
commit
ba60d6d4a9
@ -1,40 +0,0 @@
|
|||||||
# -*- coding: utf-8 -
|
|
||||||
#
|
|
||||||
# This file is part of gunicorn released under the MIT license.
|
|
||||||
# See the NOTICE for more information.
|
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
from gunicorn.workers.ggevent import BASE_WSGI_ENV, GeventWorker
|
|
||||||
from gevent import wsgi
|
|
||||||
|
|
||||||
|
|
||||||
class WSGIHandler(wsgi.WSGIHandler):
|
|
||||||
|
|
||||||
@property
|
|
||||||
def status(self):
|
|
||||||
return ' '.join([str(self.code), self.reason])
|
|
||||||
|
|
||||||
def log_request(self, length):
|
|
||||||
self.response_length = length
|
|
||||||
response_time = datetime.now() - self.time_start
|
|
||||||
self.server.log.access(self, self.environ, response_time)
|
|
||||||
|
|
||||||
def prepare_env(self):
|
|
||||||
env = super(WSGIHandler, self).prepare_env()
|
|
||||||
env['RAW_URI'] = self.request.uri
|
|
||||||
self.environ = env
|
|
||||||
return env
|
|
||||||
|
|
||||||
def handle(self):
|
|
||||||
self.time_start = datetime.now()
|
|
||||||
super(WSGIHandler, self).handle()
|
|
||||||
|
|
||||||
|
|
||||||
class WSGIServer(wsgi.WSGIServer):
|
|
||||||
base_env = BASE_WSGI_ENV
|
|
||||||
|
|
||||||
class GeventWSGIWorker(GeventWorker):
|
|
||||||
"The Gevent StreamServer based workers."
|
|
||||||
server_class = WSGIServer
|
|
||||||
wsgi_handler = WSGIHandler
|
|
||||||
8
setup.py
8
setup.py
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -
|
# -*- coding: utf-8 -
|
||||||
#
|
#
|
||||||
# This file is part of gunicorn released under the MIT license.
|
# This file is part of gunicorn released under the MIT license.
|
||||||
# See the NOTICE for more information.
|
# See the NOTICE for more information.
|
||||||
|
|
||||||
|
|
||||||
@ -45,9 +45,9 @@ setup(
|
|||||||
zip_safe = False,
|
zip_safe = False,
|
||||||
packages = find_packages(exclude=['examples', 'tests']),
|
packages = find_packages(exclude=['examples', 'tests']),
|
||||||
include_package_data = True,
|
include_package_data = True,
|
||||||
|
|
||||||
entry_points="""
|
entry_points="""
|
||||||
|
|
||||||
[console_scripts]
|
[console_scripts]
|
||||||
gunicorn=gunicorn.app.wsgiapp:run
|
gunicorn=gunicorn.app.wsgiapp:run
|
||||||
gunicorn_django=gunicorn.app.djangoapp:run
|
gunicorn_django=gunicorn.app.djangoapp:run
|
||||||
@ -57,7 +57,7 @@ setup(
|
|||||||
sync=gunicorn.workers.sync:SyncWorker
|
sync=gunicorn.workers.sync:SyncWorker
|
||||||
eventlet=gunicorn.workers.geventlet:EventletWorker
|
eventlet=gunicorn.workers.geventlet:EventletWorker
|
||||||
gevent=gunicorn.workers.ggevent:GeventWorker
|
gevent=gunicorn.workers.ggevent:GeventWorker
|
||||||
gevent_wsgi=gunicorn.workers.ggevent_wsgi:GeventWSGIWorker
|
gevent_wsgi=gunicorn.workers.ggevent_wsgi:GeventPyWSGIWorker
|
||||||
gevent_pywsgi=gunicorn.workers.ggevent:GeventPyWSGIWorker
|
gevent_pywsgi=gunicorn.workers.ggevent:GeventPyWSGIWorker
|
||||||
tornado=gunicorn.workers.gtornado:TornadoWorker
|
tornado=gunicorn.workers.gtornado:TornadoWorker
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user