Explorar o código

修改消息发送模式

longyu %!s(int64=2) %!d(string=hai) anos
pai
achega
56cf62b437
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      controllers/alaram_msg.go

+ 5 - 3
controllers/alaram_msg.go

@@ -49,9 +49,11 @@ func (this *AlarmMsgController) SmsSend() {
 	}
 	//邮箱
 	{
-		configItem, _ := cache.GetSmsConfigByCache("email")
-		if configItem != nil {
-			go services.SendAlarmMsgByEmail(req.ProjectName, req.RunMode, req.MsgBody, configItem.ConfigValue, req.Level)
+		if utils.RunMode == "release" {
+			configItem, _ := cache.GetSmsConfigByCache("email")
+			if configItem != nil {
+				go services.SendAlarmMsgByEmail(req.ProjectName, req.RunMode, req.MsgBody, configItem.ConfigValue, req.Level)
+			}
 		}
 	}
 	br.Ret = 200