保留初始化通知配置并保护新通知凭据

This commit is contained in:
xuans committed 2026-09-16 19:19:24 +08:00
1 parent efb405ea11
commit 3d1afab22e
7 files changed
+458 -23

No files matched your search

+3 -2
View File
@@ -382,10 +382,11 @@ func (c *Config) Normalize() {
if c.Notification.TimeoutSecs == 0 {
c.Notification.TimeoutSecs = 10
}
if c.Notification.RetryCount == 0 {
// 空数组表示明确关闭重试,只有旧配置未提供间隔字段时才补默认值。
if c.Notification.RetryCount == 0 && c.Notification.RetryIntervalsSecs == nil {
c.Notification.RetryCount = 3
}
if len(c.Notification.RetryIntervalsSecs) == 0 {
if c.Notification.RetryIntervalsSecs == nil {
c.Notification.RetryIntervalsSecs = []int{30, 120, 600}
}
if c.Notification.HTTPHeaders == nil {