diff --git a/config.example.yaml b/config.example.yaml index 6bdcef4..1e5439a 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -102,6 +102,10 @@ jobs: enabled: true interval: 24h retention: 168h # 7 天 + mcp_tokens_purge: + enabled: true + interval: 24h + retention: 168h # 7 days # 通知通道配置 notify: diff --git a/internal/config/config.go b/internal/config/config.go index ada24b6..0b09e89 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -122,6 +122,7 @@ type JobsConfig struct { JobReaper JobReaperCfg `mapstructure:"job_reaper"` JobPurge JobPurgeCfg `mapstructure:"job_purge"` AcpEventsPurge AcpEventsPurgeCfg `mapstructure:"acp_events_purge"` + MCPTokensPurge MCPTokensPurgeCfg `mapstructure:"mcp_tokens_purge"` } type RunnerCfg struct { @@ -160,6 +161,12 @@ type AcpEventsPurgeCfg struct { Retention time.Duration `mapstructure:"retention"` } +type MCPTokensPurgeCfg 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"` @@ -252,6 +259,9 @@ func Load(configFile string) (*Config, error) { 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("jobs.mcp_tokens_purge.enabled", true) + v.SetDefault("jobs.mcp_tokens_purge.interval", "24h") + v.SetDefault("jobs.mcp_tokens_purge.retention", "168h") v.SetDefault("notify.webhook.enabled", false) v.SetDefault("notify.webhook.timeout", "10s") v.SetDefault("acp.enabled", true)