feat: disable uvicorn worker lifespan (#2845)

### Description

Fix this Django exception: Django can only handle ASGI/HTTP connections,
not lifespan.
This commit is contained in:
Jonas L 2023-12-28 14:00:58 +01:00 committed by GitHub
parent 0e91a7db7d
commit 8743c84d0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -167,6 +167,7 @@ WORKDIR /app
CMD ["/usr/local/bin/gunicorn", \ CMD ["/usr/local/bin/gunicorn", \
"--workers=4", \ "--workers=4", \
"--worker-class=uvicorn.workers.UvicornWorker", \ "--worker-class=uvicorn.workers.UvicornWorker", \
"--lifespan", "off", \
"--log-file", "-", \ "--log-file", "-", \
"--bind=0.0.0.0:9001", \ "--bind=0.0.0.0:9001", \
"libretime_api.asgi"] "libretime_api.asgi"]

View File

@ -26,6 +26,7 @@ KillMode=mixed
ExecStart=@@VENV_DIR@@/bin/gunicorn \ ExecStart=@@VENV_DIR@@/bin/gunicorn \
--workers 4 \ --workers 4 \
--worker-class uvicorn.workers.UvicornWorker \ --worker-class uvicorn.workers.UvicornWorker \
--lifespan off \
--log-file - \ --log-file - \
--bind unix:/run/libretime-api.sock \ --bind unix:/run/libretime-api.sock \
libretime_api.asgi libretime_api.asgi