From ddc60dd1c3568defe277e60116d0ba74e06ece48 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 4 Nov 2025 19:25:01 +0800 Subject: [PATCH] revert: add subprocess handling for local model and conditional post handler execution This reverts commit 8e3550eb83f4509bd3ca42d368b347deb3b3828f. --- .../management/commands/services/services/local_model.py | 3 +-- apps/maxkb/wsgi.py | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/common/management/commands/services/services/local_model.py b/apps/common/management/commands/services/services/local_model.py index d1a248118..35c5ae92e 100644 --- a/apps/common/management/commands/services/services/local_model.py +++ b/apps/common/management/commands/services/services/local_model.py @@ -36,8 +36,7 @@ class GunicornLocalModelService(BaseService): '--max-requests-jitter', '2048', '--access-logformat', log_format, '--access-logfile', '/dev/null', - '--error-logfile', '-', - '-e', 'ENABLE_LOCAL_MODEL=1' + '--error-logfile', '-' ] if DEBUG: cmd.append('--reload') diff --git a/apps/maxkb/wsgi.py b/apps/maxkb/wsgi.py index 6c44716c0..fc271a7c3 100644 --- a/apps/maxkb/wsgi.py +++ b/apps/maxkb/wsgi.py @@ -30,10 +30,8 @@ def post_scheduler_handler(): job.run() -# 仅在非local_model模式下启动后处理函数,dev celery scheduler 不需要 -if os.environ.get("ENABLE_LOCAL_MODEL") != '1': - # 启动后处理函数 - post_handler() +# 启动后处理函数 +post_handler() # 仅在scheduler中启动定时任务,dev local_model celery 不需要 if os.environ.get('ENABLE_SCHEDULER') == '1':