mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-20 16:36:03 +08:00
Merge pull request #9882 from rainzm/notify/error_panic
Fix Notifition about Panic_Error Send too much
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user