Browse Source

fix:wind账号分配的问题,需要过滤掉不再更新的情况

Roc 1 year ago
parent
commit
3aea231d2f
2 changed files with 3 additions and 2 deletions
  1. 1 1
      models/base_from_wind.go
  2. 2 1
      services/base_from_wind.go

+ 1 - 1
models/base_from_wind.go

@@ -154,7 +154,7 @@ type ServerUrlCountGroup struct {
 // GetServerUrlCountGroupByServerUrl 获取服务器地址分组总数
 func GetServerUrlCountGroupByServerUrl() (list []ServerUrlCountGroup, err error) {
 	o := orm.NewOrm()
-	sql := `select server_url,count(1) total from edb_info where source = 2 and server_url != "" group by server_url; `
+	sql := `select server_url,count(1) total from edb_info where source = 2 AND no_update=0 AND server_url != "" group by server_url; `
 	_, err = o.Raw(sql).QueryRows(&list)
 	return
 }

+ 2 - 1
services/base_from_wind.go

@@ -116,7 +116,8 @@ func GetEdbDataFromWindUrl(windUrl, edbCode, startDate, endDate string) (item *E
 				//}
 				// 设置服务器已超限
 				errorCode = 421
-				go utils.SendEmail("wind数据接口超限", "地址:"+requestWindUrl, utils.EmailSendToUsers)
+				go alarm_msg.SendAlarmMsg(fmt.Sprintf("wind数据接口超限,地址:%s", requestWindUrl), 2)
+				//go utils.SendEmail("wind数据接口超限", "地址:"+requestWindUrl, utils.EmailSendToUsers)
 				return
 			} else if item.ErrorCode["0"] == -40520005 {
 				//.ErrorCode=-40520005