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
+16
View File
@@ -71,6 +71,22 @@ def test_build_logging_config_plain_formatter_when_disabled(tmp_path: Path) -> N
assert handlers["error"]["formatter"] == "plain"
def test_build_logging_config_resolves_default_logs_from_project_root(
monkeypatch: pytest.MonkeyPatch,
) -> None:
from core.config.settings import PROJECT_ROOT
monkeypatch.chdir(PROJECT_ROOT / "backend")
runtime = Settings().runtime
config = build_logging_config(runtime)
handlers = _get_handlers(config)
assert handlers["file"]["filename"] == str(PROJECT_ROOT / "logs" / "app.log")
assert handlers["error"]["filename"] == str(
PROJECT_ROOT / "logs" / "errors" / "app.error.log"
)
def _read_last_log_entry(log_path: Path) -> dict[str, object]:
assert log_path.exists(), f"Expected log file at {log_path}"
entries = [