refactor and fix duplicate notification

This commit is contained in:
yusing
2024-12-01 11:12:25 +08:00
parent d1cb7a5ce4
commit 58cfba7695
3 changed files with 21 additions and 22 deletions

View File

@@ -192,9 +192,10 @@ func (cfg *Config) initNotification(notifCfg []types.NotificationConfig) (err E.
if len(notifCfg) == 0 {
return
}
dispatcher := notif.StartNotifDispatcher(cfg.task)
errs := E.NewBuilder("notification providers load errors")
for i, notifier := range notifCfg {
_, err := notif.RegisterProvider(cfg.task.Subtask("notifier"), notifier)
_, err := dispatcher.RegisterProvider(notifier)
if err == nil {
continue
}