소스 검색

Alerting: fix response popover prompt when add notification channels (#18967)

lzd 6 년 전
부모
커밋
c9c0dd1ea8
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 0
      pkg/services/alerting/notifier.go
  2. 1 3
      public/app/features/alerting/NotificationsEditCtrl.ts

+ 2 - 0
pkg/services/alerting/notifier.go

@@ -64,6 +64,7 @@ func (n *notificationService) sendAndMarkAsComplete(evalContext *EvalContext, no
 	if err != nil {
 		n.log.Error("failed to send notification", "uid", notifier.GetNotifierUID(), "error", err)
 		metrics.MAlertingNotificationFailed.WithLabelValues(notifier.GetType()).Inc()
+		return err
 	}
 
 	if evalContext.IsTestRun {
@@ -108,6 +109,7 @@ func (n *notificationService) sendNotifications(evalContext *EvalContext, notifi
 		err := n.sendNotification(evalContext, notifierState)
 		if err != nil {
 			n.log.Error("failed to send notification", "uid", notifierState.notifier.GetNotifierUID(), "error", err)
+			return err
 		}
 	}
 

+ 1 - 3
public/app/features/alerting/NotificationsEditCtrl.ts

@@ -121,9 +121,7 @@ export class AlertNotificationEditCtrl {
       settings: this.model.settings,
     };
 
-    this.backendSrv.post(`/api/alert-notifications/test`, payload).then((res: any) => {
-      appEvents.emit('alert-success', ['Test notification sent', '']);
-    });
+    this.backendSrv.post(`/api/alert-notifications/test`, payload);
   }
 }