|
@@ -21,6 +21,8 @@ type WarnInfo struct {
|
|
|
Code interface{}
|
|
|
Href interface{}
|
|
|
Repeat bool
|
|
|
+ Entry bool
|
|
|
+ //Infotype int
|
|
|
}
|
|
|
|
|
|
var ErrorStypeMap = map[string]int{
|
|
@@ -28,6 +30,7 @@ var ErrorStypeMap = map[string]int{
|
|
|
"Field Value Contains Random Code": 2,
|
|
|
"Field Value Not Contains Chinese": 2,
|
|
|
"Detail File Err": 2,
|
|
|
+ "Field Type Error": 2,
|
|
|
}
|
|
|
var WarnStypeMap = map[string]int{
|
|
|
"Attachment Upload Failed": 1,
|
|
@@ -94,6 +97,7 @@ func GetHighlistDetailFilErrData() {
|
|
|
result["href"] = tmp["href"]
|
|
|
result["spidercode"] = tmp["spidercode"]
|
|
|
result["comeintime"] = time.Now().Unix()
|
|
|
+ result["entry"] = false
|
|
|
//publishtime
|
|
|
publishtime_str := qu.ObjToString(tmp["publishtime"])
|
|
|
publishtime_int := int64(0)
|
|
@@ -183,8 +187,12 @@ func GetSpiderWarnData() {
|
|
|
}()
|
|
|
info := qu.ObjToString(tmp["info"])
|
|
|
level := qu.IntAll(tmp["level"])
|
|
|
+ entry, _ := tmp["entry"].(bool)
|
|
|
//指定的错误类型和级别匹配的数据,推送spider_warn_err
|
|
|
if ErrorStypeMap[info] == level || WarnStypeMap[info] == level {
|
|
|
+ if info == "Field Value Is Null" && entry { //字段为空,但是会入bidding库的数据不推送
|
|
|
+ return
|
|
|
+ }
|
|
|
publishtime := int64(0)
|
|
|
data, ok := tmp["data"].(map[string]interface{})
|
|
|
if ok {
|
|
@@ -222,6 +230,7 @@ func GetSpiderWarnData() {
|
|
|
Code: tmp["code"],
|
|
|
Href: href,
|
|
|
Repeat: repeat,
|
|
|
+ Entry: entry,
|
|
|
}
|
|
|
result[href] = warnInfo
|
|
|
} else {
|
|
@@ -272,6 +281,7 @@ func GetSpiderWarnData() {
|
|
|
"data": w.Data,
|
|
|
"ok": false,
|
|
|
"from": "warn",
|
|
|
+ "entry": w.Entry,
|
|
|
})
|
|
|
if len(saveArr) > 500 {
|
|
|
util.MgoS.SaveBulk("spider_warn_err", saveArr...)
|