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:
@@ -9,6 +9,7 @@ from app.features.memoir.asset_resolver import (
|
||||
parse_asset_refs,
|
||||
strip_image_placeholders,
|
||||
)
|
||||
from app.features.memoir.constants import memoir
|
||||
from app.features.memoir.memoir_images.schema import (
|
||||
IMAGE_STATUS_FAILED,
|
||||
IMAGE_STATUS_PENDING,
|
||||
@@ -61,7 +62,7 @@ def chapter_eligible_for_cover_by_inline_body_image_count(
|
||||
chapter: Any, *, markdown: str | None = None
|
||||
) -> bool:
|
||||
"""正文内 asset:// 数量 ≥ 配置阈值时允许封面;markdown 非 None 时仅用该串计数。"""
|
||||
min_required = int(settings.memoir_min_inline_images_for_chapter_cover)
|
||||
min_required = int(memoir.min_inline_images_for_chapter_cover)
|
||||
return count_chapter_inline_body_images(chapter, markdown=markdown) >= min_required
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user