fix: lock/unlock cleanup

This commit is contained in:
Qiu Jian
2020-09-15 12:22:38 +08:00
parent e197ff815a
commit 41f932e381
9 changed files with 34 additions and 28 deletions
+2 -1
View File
@@ -557,8 +557,9 @@ func (alert *SAlert) AttachNotification(
return nil, httperrors.NewNotAcceptableError("alert already attached to notification")
}
defer lockman.ReleaseObject(ctx, alert)
lockman.LockObject(ctx, alert)
defer lockman.ReleaseObject(ctx, alert)
alertNoti := new(SAlertnotification)
alertNoti.AlertId = alert.GetId()
alertNoti.Index, err = alert.getNotificationIndex()