Browse Source

修复指标数据

xyxie 1 week ago
parent
commit
a6df605ebc
1 changed files with 10 additions and 1 deletions
  1. 10 1
      controllers/edb_data.go

+ 10 - 1
controllers/edb_data.go

@@ -100,7 +100,16 @@ func (this *EdbDataController) SaveByBinlog() {
 		}
 		value, ok := item.Value.(float64)
 		if !ok {
-			continue
+			valueStr, ok:= item.Value.(string)
+			if !ok {
+				utils.FileLog.Info("binlog数据类型异常,Err:" + err.Error(), "item", item)
+				continue
+			}
+			value, err = strconv.ParseFloat(valueStr, 64)
+			if err != nil {
+				utils.FileLog.Info("binlog数据类型转换异常,Err:" + err.Error(), "item", item)
+				continue
+			}
 		}
 		createTime, _ := time.ParseInLocation("2006-01-02 15:04:05", item.CreateTime, time.Local)
 		modifyTime, _ := time.ParseInLocation("2006-01-02 15:04:05", item.ModifyTime, time.Local)