|
@@ -21,19 +21,20 @@ var LuaErrTypeInfo = map[string]string{
|
|
|
NEWTASK_DOWNLOADERR: "下载异常",
|
|
|
NEWTASK_DATAINFOWARN: "数据异常警告",
|
|
|
}
|
|
|
-var DataInfoErrMap = map[int]string{
|
|
|
+var DataInfoErrMap = map[int]string{ //需要建数据异常错误的类型
|
|
|
1: "Save Coll Error",
|
|
|
- 2: "File Size Or Url Error",
|
|
|
4: "Field Value Is Null",
|
|
|
9: "Html Contains Temp Language",
|
|
|
10: "Publishtime Is Error",
|
|
|
11: "Publishtime Is Zero",
|
|
|
12: "Field Type Error",
|
|
|
}
|
|
|
-var DataInfoWarnMap = map[int]string{
|
|
|
- 5: "Field Value Contains Random Code",
|
|
|
- 6: "Field Value Not Contains Chinese",
|
|
|
- 8: "Detail File Err",
|
|
|
+var DataInfoWarnMap = map[int]string{ //需要建数据异常警告的类型
|
|
|
+ 2: "File Size Or Url Error",
|
|
|
+ 5: "Field Value Contains Random Code",
|
|
|
+ 6: "Field Value Not Contains Chinese",
|
|
|
+ 8: "Detail File Err",
|
|
|
+ 10: "Publishtime Is Error", //与数据异常错误中的一致,通过判断异常数据量决定最终属于异常类型还是警告类型
|
|
|
}
|
|
|
|
|
|
var UpdateLuaconfig [][]map[string]interface{}
|
|
@@ -335,6 +336,7 @@ func getSpiderWarnInfo() {
|
|
|
infotype := qu.IntAll(tmp["infotype"])
|
|
|
level := qu.IntAll(tmp["level"])
|
|
|
field := qu.ObjToString(tmp["field"])
|
|
|
+ //参考文档:https://www.kdocs.cn/l/cbZ8u11Akkj4(异常数据统计)
|
|
|
if infotype == 3 || infotype == 7 {
|
|
|
return
|
|
|
}
|
|
@@ -832,6 +834,9 @@ func dataInfoErr(sp *NewSpider) {
|
|
|
resultDescription := ""
|
|
|
for err, _ := range DataInfoErrMap {
|
|
|
if wf := sp.WarnInfoMap[err]; wf != nil {
|
|
|
+ if err == 10 && wf.Fields["publishtime"] <= 1 { //发布时间异常,根据异常量划分是错误还是告警
|
|
|
+ continue
|
|
|
+ }
|
|
|
tmpDescription := ""
|
|
|
for field, href := range wf.Hrefs {
|
|
|
tmpDescription += " 字段" + field + ":" + href + "\n"
|
|
@@ -1073,6 +1078,9 @@ func dataInfoWarn(sp *NewSpider) {
|
|
|
resultDescription := ""
|
|
|
for err, _ := range DataInfoWarnMap {
|
|
|
if wf := sp.WarnInfoMap[err]; wf != nil {
|
|
|
+ if err == 10 && wf.Fields["publishtime"] > 1 { //发布时间异常,根据异常量划分是错误还是告警
|
|
|
+ continue
|
|
|
+ }
|
|
|
tmpDescription := ""
|
|
|
for field, href := range wf.Hrefs {
|
|
|
tmpDescription += " 字段" + field + ":" + href + "\n"
|