refactor: Web 服务器从 gunicorn 迁移到 uvicorn

This commit is contained in:
qzl
2026-03-06 17:55:01 +08:00
parent b6087fd195
commit 105e7849fe
12 changed files with 108 additions and 22 deletions
@@ -17,4 +17,17 @@ def test_worker_commands_use_taskiq() -> None:
assert "core.taskiq.app:bulk_broker" in content
assert 'pgrep -f "taskiq.*worker"' in content
assert 'pkill -f "taskiq.*worker"' in content
assert 'pgrep -f "gunicorn.*app:app"' in content
assert 'pkill -f "gunicorn.*app:app"' in content
assert removed_runner not in content
def test_web_command_uses_uvicorn_only() -> None:
content = APP_SCRIPT.read_text(encoding="utf-8")
assert "uv run uvicorn app:app" in content
assert 'WEB_PORT="${SOCIAL_WEB__PORT:-5775}"' in content
assert "SOCIAL_WEB__WORKERS" in content
assert 'UVICORN_LOG_LEVEL="${UVICORN_LOG_LEVEL,,}"' in content
assert "SOCIAL_WEB__GUNICORN__" not in content
assert "uv run gunicorn" not in content