feat(governance): unify durable event retention

This commit is contained in:
jxxghp
2026-08-26 12:45:44 +08:00
parent f5dacf79c3
commit 362f606751
29 changed files with 948 additions and 121 deletions
+10
View File
@@ -218,6 +218,16 @@ class ConfigModel(BaseModel):
DATA_CLEANUP_TRANSFER_HISTORY_DAYS: int = 365 * 3
# 下载失败冷却记录保留天数,0为不清理
DATA_CLEANUP_DOWNLOAD_FAILURE_DAYS: int = 7
# 订阅完成历史保留天数,0为不清理
DATA_CLEANUP_SUBSCRIBE_HISTORY_DAYS: int = 365 * 3
# Agent 会话历史保留天数,0为不清理
DATA_CLEANUP_AGENT_CHAT_DAYS: int = 180
# Agent 定时任务运行历史保留天数,0为不清理
DATA_CLEANUP_AGENT_TASK_RUN_DAYS: int = 180
# Outbox 已完成记录保留天数,0为不清理
DATA_CLEANUP_OUTBOX_COMPLETED_DAYS: int = 30
# Outbox 死信记录保留天数,0为不清理
DATA_CLEANUP_OUTBOX_DEAD_DAYS: int = 90
# ==================== 缓存配置 ====================
# 缓存类型,支持 cachetools 和 redis,默认使用 cachetools
+5
View File
@@ -159,9 +159,14 @@ _DURABLE_REQUIRED = {
EventType.SubscribeAdded,
EventType.SubscribeModified,
EventType.SubscribeDeleted,
EventType.SubscribeComplete,
EventType.DownloadAdded,
EventType.TransferComplete,
EventType.TransferFailed,
EventType.SubtitleTransferComplete,
EventType.SubtitleTransferFailed,
EventType.AudioTransferComplete,
EventType.AudioTransferFailed,
}
_TARGET_PLUGIN = {EventType.PluginAction, EventType.PluginTriggered}
_HOST_ONLY = {EventType.SystemError, EventType.ConfigChanged, EventType.ModuleReload}