From 88c0e68a27a488cc19f443163cebbe5a12443ba1 Mon Sep 17 00:00:00 2001 From: Jason Mok Date: Fri, 31 May 2024 01:28:36 -0400 Subject: [PATCH] chore: Replace deprecated uvicorn.workers with uvicorn-worker --- {{cookiecutter.project_slug}}/Procfile | 2 +- {{cookiecutter.project_slug}}/compose/production/django/start | 2 +- {{cookiecutter.project_slug}}/gulpfile.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_slug}}/Procfile b/{{cookiecutter.project_slug}}/Procfile index 2f2fbe927..ba3ed5d04 100644 --- a/{{cookiecutter.project_slug}}/Procfile +++ b/{{cookiecutter.project_slug}}/Procfile @@ -1,6 +1,6 @@ release: python manage.py migrate {%- if cookiecutter.use_async == "y" %} -web: gunicorn config.asgi:application -k uvicorn.workers.UvicornWorker +web: gunicorn config.asgi:application -k uvicorn-worker.UvicornWorker {%- else %} web: gunicorn config.wsgi:application {%- endif %} diff --git a/{{cookiecutter.project_slug}}/compose/production/django/start b/{{cookiecutter.project_slug}}/compose/production/django/start index 73f686bd7..f5444d710 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/start @@ -28,7 +28,7 @@ if compress_enabled; then fi {%- endif %} {%- if cookiecutter.use_async == 'y' %} -exec /usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn.workers.UvicornWorker +exec /usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn-worker.UvicornWorker {%- else %} exec /usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app {%- endif %} diff --git a/{{cookiecutter.project_slug}}/gulpfile.js b/{{cookiecutter.project_slug}}/gulpfile.js index df434c134..87fa57bd1 100644 --- a/{{cookiecutter.project_slug}}/gulpfile.js +++ b/{{cookiecutter.project_slug}}/gulpfile.js @@ -106,7 +106,7 @@ function imgCompression() { function asyncRunServer() { const cmd = spawn( 'gunicorn', - ['config.asgi', '-k', 'uvicorn.workers.UvicornWorker', '--reload'], + ['config.asgi', '-k', 'uvicorn-worker.UvicornWorker', '--reload'], {stdio: 'inherit'}, ); cmd.on('close', function (code) {