feat: 增加处理历史保留配置

This commit is contained in:
2026-05-19 12:01:26 +08:00
parent f1075695a1
commit a3cc9f347c
9 changed files with 208 additions and 35 deletions
+6
View File
@@ -23,3 +23,9 @@ def reset_task_lock() -> None:
global_task_lock["stage"] = None
global_task_lock["started_at"] = None
def apply_history_retention() -> int:
retention = config.history_retention.normalized()
if not retention.enabled:
return 0
return history_manager.prune_finished(retention.keep_count)