refactor: 清理后端诊断输出

This commit is contained in:
2026-06-25 12:08:45 +08:00
parent 4c713d177c
commit be19dbc888
4 changed files with 24 additions and 8 deletions
+5 -1
View File
@@ -1,8 +1,12 @@
import logging
from typing import Any
from app import state
logger = logging.getLogger(__name__)
def set_task_stage(task_id: str, stage: str, logs: list[str], status: str = "processing") -> None:
state.processing_tasks[task_id] = {
"logs": logs.copy(),
@@ -29,4 +33,4 @@ def apply_history_retention_safely() -> None:
try:
state.apply_history_retention()
except Exception as exc:
print(f"自动清理处理历史失败: {exc}")
logger.warning("Failed to apply history retention: %s", exc)