|
@@ -123,7 +123,7 @@ func isInspectionTime(config *edb_inspection.EdbInspectionConfig, currTimeStr st
|
|
|
// @Description: 添加巡检记录
|
|
|
// @param cont context.Context
|
|
|
// @return err error
|
|
|
-func AddEdbInspectionRecord() (err error) {
|
|
|
+func AddEdbInspectionRecord(cont context.Context) (err error) {
|
|
|
now := time.Now()
|
|
|
|
|
|
// 获取需要巡检的配置
|
|
@@ -164,7 +164,7 @@ func AddEdbInspectionRecord() (err error) {
|
|
|
}
|
|
|
|
|
|
refreshResult := false
|
|
|
- refreshErrMsg := "状态异常:服务异常"
|
|
|
+ refreshErrMsg := "服务异常"
|
|
|
|
|
|
// 数据更新
|
|
|
resp, tmpErr := data.RefreshEdbData(edbInfo.EdbInfoId, edbInfo.Source, edbInfo.SubSource, edbInfo.EdbCode, startDate)
|
|
@@ -179,9 +179,9 @@ func AddEdbInspectionRecord() (err error) {
|
|
|
if tmpErr == nil {
|
|
|
if refreshRecord.DataUpdateResult == 1 {
|
|
|
refreshResult = true
|
|
|
- refreshErrMsg = "状态正常"
|
|
|
+ refreshErrMsg = ""
|
|
|
} else {
|
|
|
- refreshErrMsg = "状态异常:"+refreshRecord.DataUpdateFailedReason
|
|
|
+ refreshErrMsg = refreshRecord.DataUpdateFailedReason
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -197,7 +197,7 @@ func AddEdbInspectionRecord() (err error) {
|
|
|
CreateTime: now,
|
|
|
ModifyTime: now,
|
|
|
}
|
|
|
-
|
|
|
+ // 巡检结果(1:成功,2:失败)
|
|
|
if refreshResult {
|
|
|
record.InspectionResult = 1 // 成功
|
|
|
} else {
|