From a9a6b87fefbe7c0a97b6936ee35a01dc103c261c Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 14 Jul 2025 21:33:03 +0800 Subject: [PATCH] test for asgi --- deploy/supervisord.conf | 2 +- oj/asgi.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 oj/asgi.py diff --git a/deploy/supervisord.conf b/deploy/supervisord.conf index 4e59016..7956950 100644 --- a/deploy/supervisord.conf +++ b/deploy/supervisord.conf @@ -28,7 +28,7 @@ stopwaitsecs = 5 killasgroup=true [program:gunicorn] -command=gunicorn oj.wsgi --user server --group spj --bind 127.0.0.1:8080 --workers %(ENV_MAX_WORKER_NUM)s --threads 4 --max-requests-jitter 10000 --max-requests 1000000 --keep-alive 32 +command=gunicorn oj.asgi --user server --group spj --bind 127.0.0.1:8080 --workers %(ENV_MAX_WORKER_NUM)s --threads 4 --max-requests-jitter 10000 --max-requests 1000000 --keep-alive 32 --worker-class uvicorn.workers.UvicornWorker directory=/app/ stdout_logfile=/data/log/gunicorn.log stderr_logfile=/data/log/gunicorn.log diff --git a/oj/asgi.py b/oj/asgi.py new file mode 100644 index 0000000..382df7d --- /dev/null +++ b/oj/asgi.py @@ -0,0 +1,7 @@ +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "oj.settings") + +application = get_asgi_application()