diff --git a/pkg/notify/models/receiver.go b/pkg/notify/models/receiver.go index 53312f6537..666e69c0d9 100644 --- a/pkg/notify/models/receiver.go +++ b/pkg/notify/models/receiver.go @@ -977,12 +977,14 @@ func (rm *SReceiverManager) OnUpdate(oldObj, newObj *jsonutils.JSONDict) { receiver := &receivers[0] uname, _ := newObj.GetString("name") domainId, _ := newObj.GetString("domain_id") - if receiver.Name == uname && receiver.DomainId == domainId { + lang, _ := newObj.GetString("lang") + if receiver.Name == uname && receiver.DomainId == domainId && receiver.Lang == lang { return } _, err = db.Update(receiver, func() error { receiver.Name = uname receiver.DomainId = domainId + receiver.Lang = lang return nil }) if err != nil { diff --git a/pkg/notify/options/options.go b/pkg/notify/options/options.go index cd390b4ac8..db48f5f48d 100644 --- a/pkg/notify/options/options.go +++ b/pkg/notify/options/options.go @@ -31,7 +31,7 @@ type NotifyOption struct { InitNotificationScope int `help:"initialize data of notification with in InitNotificationScope hours" default:"100"` MaxSyncNotification int `help:"The max number of notification sync from old data source" default:"1000"` - VerifyExpireInterval int `help:"expire interval of verify message; minutes" default:"5"` + VerifyExpireInterval int `help:"expire interval of verify message; minutes" default:"2"` VerifyValidInterval int `help:"valid interval of verify message; miniutes" default:"20"` } diff --git a/pkg/notify/tasks/notifications_send_task.go b/pkg/notify/tasks/notifications_send_task.go index a9d05bf017..a94175be46 100644 --- a/pkg/notify/tasks/notifications_send_task.go +++ b/pkg/notify/tasks/notifications_send_task.go @@ -175,7 +175,7 @@ func (self *NotificationSendTask) OnInit(ctx context.Context, obj db.IStandalone // check result for _, fd := range fds { rn := contactMap[fd.Contact] - sendFail(rn, err.Error()) + sendFail(rn, fd.Reason) delete(contactMap, fd.Contact) } // after send for successful notify