From 218036c0ea8b3df22e1913923088c66434eb67f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BC=BA?= <1206709430@qq.com> Date: Sat, 22 Jun 2024 11:45:20 +0800 Subject: [PATCH] =?UTF-8?q?dvadmin3-build=20=E5=85=BC=E5=AE=B9=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/main.py b/backend/main.py index 2408243..c0419d9 100644 --- a/backend/main.py +++ b/backend/main.py @@ -9,5 +9,9 @@ from application.settings import LOGGING if __name__ == '__main__': multiprocessing.freeze_support() - uvicorn.run("application.asgi:application", reload=False, host="0.0.0.0", port=8000, workers=4, + workers = 4 + if os.sys.platform.startswith('win'): + # Windows操作系统 + workers = None + uvicorn.run("application.asgi:application", reload=False, host="0.0.0.0", port=8000, workers=workers, log_config=LOGGING)