Back to uvicorn workers from eventlet.
The eventlet API has way too many dependency issues with gunicorn. Still TODO: Fix or at least mitigate the WSGI workers timeout issue when they handle websocket connections.
This commit is contained in:
parent
8102178ba4
commit
692180c653
5 changed files with 13 additions and 5 deletions
|
@ -303,6 +303,7 @@ autodoc_mock_imports = [
|
|||
'bluetooth_numbers',
|
||||
'TheengsDecoder',
|
||||
'simple_websocket',
|
||||
'uvicorn',
|
||||
]
|
||||
|
||||
sys.path.insert(0, os.path.abspath('../..'))
|
||||
|
|
|
@ -252,8 +252,8 @@ class HttpBackend(Backend):
|
|||
kwargs = {
|
||||
'bind': f'{self.bind_address}:{self.port}',
|
||||
'workers': (cpu_count() * 2) + 1,
|
||||
'worker_class': 'eventlet',
|
||||
'timeout': 60,
|
||||
'worker_class_str': f'{__package__}.app.UvicornWorker',
|
||||
'timeout': 30,
|
||||
}
|
||||
|
||||
WSGIApplicationWrapper(f'{__package__}.app:application', kwargs).run()
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
from typing import Any, Dict
|
||||
|
||||
from gunicorn.app.wsgiapp import WSGIApplication
|
||||
from uvicorn.workers import UvicornWorker as BaseUvicornWorker
|
||||
|
||||
|
||||
class UvicornWorker(BaseUvicornWorker):
|
||||
CONFIG_KWARGS: Dict[str, Any] = {"loop": "auto", "http": "auto", "lifespan": "on"}
|
||||
|
||||
|
||||
class WSGIApplicationWrapper(WSGIApplication):
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
alembic
|
||||
bcrypt
|
||||
croniter
|
||||
eventlet
|
||||
flask
|
||||
frozendict
|
||||
gunicorn
|
||||
|
@ -22,6 +21,7 @@ rsa
|
|||
simple_websocket
|
||||
sqlalchemy
|
||||
tz
|
||||
uvicorn
|
||||
websocket-client
|
||||
wsproto
|
||||
zeroconf>=0.27.0
|
||||
|
|
4
setup.py
4
setup.py
|
@ -63,10 +63,9 @@ setup(
|
|||
'alembic',
|
||||
'bcrypt',
|
||||
'croniter',
|
||||
'eventlet',
|
||||
'flask',
|
||||
'frozendict',
|
||||
'gunicorn @ https://github.com/benoitc/gunicorn/tarball/master',
|
||||
'gunicorn',
|
||||
'marshmallow',
|
||||
'marshmallow_dataclass',
|
||||
'python-dateutil',
|
||||
|
@ -78,6 +77,7 @@ setup(
|
|||
'simple_websocket',
|
||||
'sqlalchemy',
|
||||
'tz',
|
||||
'uvicorn',
|
||||
'websocket-client',
|
||||
'wheel',
|
||||
'wsproto',
|
||||
|
|
Loading…
Reference in a new issue