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
@@ -22,12 +22,18 @@ def test_taskiq_app_configures_logging_on_import(
sys.modules.pop("core.taskiq", None)
called = {"count": 0, "args": None}
banner_called = {"count": 0, "kwargs": None}
def _fake_configure_logging(*args: object, **__: object) -> None:
called["count"] += 1
called["args"] = args
def _fake_log_service_banner(**kwargs: object) -> None:
banner_called["count"] += 1
banner_called["kwargs"] = kwargs
monkeypatch.setattr("core.logging.configure_logging", _fake_configure_logging)
monkeypatch.setattr("core.logging.log_service_banner", _fake_log_service_banner)
importlib.import_module("core.taskiq.app")
@@ -35,3 +41,8 @@ def test_taskiq_app_configures_logging_on_import(
assert called["count"] == 1
assert called["args"] == (config,)
assert banner_called["count"] == 1
assert banner_called["kwargs"] == {
"service_name": config.runtime.service_name,
"environment": config.runtime.environment,
}