Roc 2 years ago
parent
commit
ed07898f40
1 changed files with 5 additions and 4 deletions
  1. 5 4
      services/base_from_wind.go

+ 5 - 4
services/base_from_wind.go

@@ -85,10 +85,10 @@ func GetEdbDataFromWindUrl(windUrl, edbCode, startDate, endDate string) (item *E
 		return GetEdbDataFromWind(edbCode, startDate, endDate)
 	}
 
-	thsUrl := windUrl + `edbInfo/wind?EdbCode=%s&StartDate=%s&EndDate=%s`
-	thsUrl = fmt.Sprintf(thsUrl, edbCode, startDate, endDate)
-	utils.FileLog.Info(fmt.Sprintf("windUrl:%s", thsUrl))
-	body, err := http.Get(thsUrl)
+	requestWindUrl := windUrl + `edbInfo/wind?EdbCode=%s&StartDate=%s&EndDate=%s`
+	requestWindUrl = fmt.Sprintf(requestWindUrl, edbCode, startDate, endDate)
+	utils.FileLog.Info(fmt.Sprintf("windUrl:%s", requestWindUrl))
+	body, err := http.Get(requestWindUrl)
 	fmt.Println("GetEdbDataByWind body:")
 	fmt.Println(string(body))
 	utils.FileLog.Info(fmt.Sprint("wind result:", string(body)))
@@ -116,6 +116,7 @@ func GetEdbDataFromWindUrl(windUrl, edbCode, startDate, endDate string) (item *E
 				//}
 				// 设置服务器已超限
 				errorCode = 421
+				go utils.SendEmail("wind数据接口超限", "地址:"+requestWindUrl, utils.EmailSendToUsers)
 				return
 			} else if item.ErrorCode["0"] == -40520005 {
 				//.ErrorCode=-40520005