Prechádzať zdrojové kódy

新增彭博接口检测

hongze 3 rokov pred
rodič
commit
ddbdafd1fe
2 zmenil súbory, kde vykonal 18 pridanie a 0 odobranie
  1. 15 0
      services/data_manage/edb_info.go
  2. 3 0
      services/task.go

+ 15 - 0
services/data_manage/edb_info.go

@@ -137,3 +137,18 @@ func CheckDataInterface() (err error) {
 	}()
 	return
 }
+
+func CheckPbDataInterface() (err error) {
+	go func() {
+		checkUrl := utils.Hz_Data_PB_Url + `hz_server`
+		body, err := http.Get(checkUrl)
+		if err != nil {
+			go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"检测数据接口:失败提醒", "CheckPbDataInterface ErrMsg:"+err.Error(), utils.EmailSendToUsers)
+		}
+		result := string(body)
+		if result != "1" {
+			go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"检测数据接口:失败提醒", "CheckPbDataInterface ErrMsg:"+string(body), utils.EmailSendToUsers)
+		}
+	}()
+	return
+}

+ 3 - 0
services/task.go

@@ -90,6 +90,9 @@ func releaseTask(){
 
 	checkDataInterface := toolbox.NewTask("checkDataInterface", "0 */3 * * * * ", data_manage.CheckDataInterface)
 	toolbox.AddTask("checkDataInterface", checkDataInterface)
+
+	checkPbDataInterface := toolbox.NewTask("checkPbDataInterface", "0 */5 * * * * ", data_manage.CheckPbDataInterface)
+	toolbox.AddTask("checkPbDataInterface", checkPbDataInterface)
 }
 
 func TaskTest(){