feat(app): wire acp_events_purge runner into jobs scheduler

This commit is contained in:
2026-05-07 17:47:50 +08:00
parent 4c19ce29ca
commit faebfc3135
5 changed files with 40 additions and 0 deletions
+10
View File
@@ -120,6 +120,7 @@ type JobsConfig struct {
AttachmentCleanup AttachmentCleanupCfg `mapstructure:"attachment_cleanup"`
JobReaper JobReaperCfg `mapstructure:"job_reaper"`
JobPurge JobPurgeCfg `mapstructure:"job_purge"`
AcpEventsPurge AcpEventsPurgeCfg `mapstructure:"acp_events_purge"`
}
type RunnerCfg struct {
@@ -152,6 +153,12 @@ type JobPurgeCfg struct {
CompletedRetention time.Duration `mapstructure:"completed_retention"`
}
type AcpEventsPurgeCfg struct {
Enabled bool `mapstructure:"enabled"`
Interval time.Duration `mapstructure:"interval"`
Retention time.Duration `mapstructure:"retention"`
}
// NotifyConfig 是 notify 模块的可选外发通道配置。当前仅 webhook。
type NotifyConfig struct {
Webhook WebhookCfg `mapstructure:"webhook"`
@@ -227,6 +234,9 @@ func Load(configFile string) (*Config, error) {
v.SetDefault("jobs.job_purge.enabled", true)
v.SetDefault("jobs.job_purge.interval", "24h")
v.SetDefault("jobs.job_purge.completed_retention", "168h")
v.SetDefault("jobs.acp_events_purge.enabled", true)
v.SetDefault("jobs.acp_events_purge.interval", "24h")
v.SetDefault("jobs.acp_events_purge.retention", "168h")
v.SetDefault("notify.webhook.enabled", false)
v.SetDefault("notify.webhook.timeout", "10s")
v.SetDefault("acp.enabled", true)