refactor(api): TOML 配置 SSOT、统一错误契约、Auth/事务加固与可观测性 (#33)
配置 SSOT(TOML + .env) 统一错误契约 Auth 与事务边界 Redis / Celery 可靠性:业务 Redis(DB/0)与 Celery broker/backend(DB/1)显式拆分;连接池、sync client 可观测性(OpenTelemetry + LGTM)
This commit is contained in:
@@ -13,6 +13,7 @@ from app.agents.memoir.story_route_payload import (
|
||||
_truncate_body_for_route,
|
||||
)
|
||||
from app.core.config import Settings
|
||||
from app.features.story.constants import story
|
||||
|
||||
|
||||
def _story(**kwargs):
|
||||
@@ -102,8 +103,8 @@ def test_long_body_uses_head_tail():
|
||||
|
||||
def test_total_budget_downgrades_tail_rows(monkeypatch):
|
||||
settings = Settings()
|
||||
monkeypatch.setattr(settings, "story_route_candidate_total_max_chars", 800)
|
||||
monkeypatch.setattr(settings, "story_route_index_preview_chars", 40)
|
||||
monkeypatch.setattr(story, "route_candidate_total_max_chars", 800)
|
||||
monkeypatch.setattr(story, "route_index_preview_chars", 40)
|
||||
stories = [
|
||||
_story(
|
||||
id="1",
|
||||
|
||||
Reference in New Issue
Block a user