@@ -580,7 +580,11 @@ func sendAlerts(alert dto.AlertDTO, alertType, quota, quotaType string, params [
580580 AlertId : alert .ID ,
581581 Count : todayCount + 1 ,
582582 }
583- _ = xpack .CreateSMSAlertLog (alertType , alert , create , quotaType , params , constant .SMS )
583+ alertErr := xpack .CreateSMSAlertLog (alertType , alert , create , quotaType , params , constant .SMS )
584+ if alertErr != nil {
585+ global .LOG .Infof ("%s alert sms push faild, err: %v" , alertType , alertErr .Error ())
586+ continue
587+ }
584588 alertUtil .CreateNewAlertTask (quota , alertType , quotaType , constant .SMS )
585589 global .LOG .Infof ("%s alert sms push successful" , alertType )
586590
@@ -600,7 +604,11 @@ func sendAlerts(alert dto.AlertDTO, alertType, quota, quotaType string, params [
600604 create .AlertDetail = alertUtil .ProcessAlertDetail (alertInfo , quotaType , params , constant .Email )
601605 transport := xpack .LoadRequestTransport ()
602606 agentInfo , _ := xpack .GetAgentInfo ()
603- _ = alertUtil .CreateEmailAlertLog (create , alertInfo , params , transport , agentInfo )
607+ alertErr := alertUtil .CreateEmailAlertLog (create , alertInfo , params , transport , agentInfo )
608+ if alertErr != nil {
609+ global .LOG .Infof ("%s alert email push faild, err: %v" , alertType , alertErr .Error ())
610+ continue
611+ }
604612 alertUtil .CreateNewAlertTask (quota , alertType , quotaType , constant .Email )
605613 global .LOG .Infof ("%s alert email push successful" , alertType )
606614 }
0 commit comments