Roc 3 năm trước cách đây
mục cha
commit
3ea44e9adb
1 tập tin đã thay đổi với 10 bổ sung5 xóa
  1. 10 5
      services/task.go

+ 10 - 5
services/task.go

@@ -255,7 +255,14 @@ func AddEdbTask(cont context.Context) (err error) {
 	//失败列表
 	failList := make([]string, 0)
 
-	wxUser, _ := models.GetWxUserByMobile("17634786714")
+	debugNoticeUserId := 0 //测试环境,需要发送消息的用户
+	if utils.RunMode == "debug" {
+		tmpWxUser, tmpErr := models.GetWxUserByMobile("17634786714")
+		if tmpErr == nil && tmpWxUser != nil {
+			//debugNoticeUserId = 44078 //测试环境的话,发送邮箱给颜鹏
+			debugNoticeUserId = int(tmpWxUser.UserId) //测试环境的话,发送邮箱给嘉豪
+		}
+	}
 	//task.globalTaskManager.adminTaskList
 	for _, edb := range list {
 		tmpEdb := edb            //指标信息
@@ -391,10 +398,8 @@ func AddEdbTask(cont context.Context) (err error) {
 						return
 					}
 				}
-				if utils.RunMode == "debug" && wxUser != nil {
-					//tmpEdb.UserId = 44078 //测试环境的话,发送邮箱给颜鹏
-					tmpEdb.UserId = int(wxUser.UserId) //测试环境的话,发送邮箱给嘉豪
-
+				if utils.RunMode == "debug" && debugNoticeUserId > 0 {
+					tmpEdb.UserId = debugNoticeUserId //测试环境的话,发送邮箱给嘉豪
 				}
 
 				//数据过期时间