|
@@ -58,6 +58,7 @@ type NewSpider struct {
|
|
Detail_DownloadSuccessNum int `bson:"detail_downloadsuccessnum"`
|
|
Detail_DownloadSuccessNum int `bson:"detail_downloadsuccessnum"`
|
|
Detail_DownloadFailNum int `bson:"detail_downloadfailnum"`
|
|
Detail_DownloadFailNum int `bson:"detail_downloadfailnum"`
|
|
List_IsGetData bool `bson:"list_isgetdata"`
|
|
List_IsGetData bool `bson:"list_isgetdata"`
|
|
|
|
+ HeartTime int64 `bson:"heart_time"`
|
|
List_RunTimes int `bson:"list_runtimes"`
|
|
List_RunTimes int `bson:"list_runtimes"`
|
|
List_NoDataTimes int `bson:"list_nodatatimes"`
|
|
List_NoDataTimes int `bson:"list_nodatatimes"`
|
|
List_AllInTimes int `bson:"list_allintimes"`
|
|
List_AllInTimes int `bson:"list_allintimes"`
|
|
@@ -400,6 +401,7 @@ func getSpiderHeart() {
|
|
// limitDayNum = -1
|
|
// limitDayNum = -1
|
|
//}
|
|
//}
|
|
sp.List_IsGetData = findListHeart > util.GetTime(0)-int64(12*3600) //前一天12点
|
|
sp.List_IsGetData = findListHeart > util.GetTime(0)-int64(12*3600) //前一天12点
|
|
|
|
+ sp.HeartTime = findListHeart
|
|
}
|
|
}
|
|
lock.Unlock()
|
|
lock.Unlock()
|
|
}(tmp)
|
|
}(tmp)
|
|
@@ -745,7 +747,8 @@ func listErr(sp *NewSpider) {
|
|
if sp.Platform == "python" && !sp.Py_IsValid {
|
|
if sp.Platform == "python" && !sp.Py_IsValid {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if !sp.List_IsGetData || sp.List_RunTimes == 0 {
|
|
|
|
|
|
+ //if !sp.List_IsGetData || sp.List_RunTimes == 0 {
|
|
|
|
+ if !sp.List_IsGetData {
|
|
errFlag := false
|
|
errFlag := false
|
|
if sp.CodeTags != nil {
|
|
if sp.CodeTags != nil {
|
|
tagTime, _ := sp.CodeTags[NEWTASK_LISTERR].(int64) //用struct接收,会转为floa64
|
|
tagTime, _ := sp.CodeTags[NEWTASK_LISTERR].(int64) //用struct接收,会转为floa64
|
|
@@ -763,11 +766,20 @@ func listErr(sp *NewSpider) {
|
|
//}
|
|
//}
|
|
sp.ErrType = qu.IntAll(NEWTASK_LISTERR)
|
|
sp.ErrType = qu.IntAll(NEWTASK_LISTERR)
|
|
sp.ErrTypeMap[qu.IntAll(NEWTASK_LISTERR)] = true
|
|
sp.ErrTypeMap[qu.IntAll(NEWTASK_LISTERR)] = true
|
|
- if !sp.List_IsGetData {
|
|
|
|
- sp.ErrDescription += "列表页异常:\n 无最新心跳\n"
|
|
|
|
- } else if sp.List_RunTimes == 0 {
|
|
|
|
- sp.ErrDescription += "列表页异常:\n 列表页共采集" + fmt.Sprint(sp.List_RunTimes) + "轮,其中有" + fmt.Sprint(sp.List_NoDataTimes) + "轮无数据\n"
|
|
|
|
|
|
+ heartTime := ""
|
|
|
|
+ if sp.HeartTime != 0 {
|
|
|
|
+ heartTime = qu.FormatDateByInt64(&sp.HeartTime, qu.Date_Full_Layout)
|
|
}
|
|
}
|
|
|
|
+ sp.ErrDescription += "列表页异常:\n 无最新心跳:" + heartTime + "\n"
|
|
|
|
+ //if !sp.List_IsGetData {
|
|
|
|
+ // heartTime := ""
|
|
|
|
+ // if sp.HeartTime != 0 {
|
|
|
|
+ // heartTime = qu.FormatDateByInt64(&sp.HeartTime, qu.Date_Full_Layout)
|
|
|
|
+ // }
|
|
|
|
+ // sp.ErrDescription += "列表页异常:\n 无最新心跳:" + heartTime + "\n"
|
|
|
|
+ //} else if sp.List_RunTimes == 0 {
|
|
|
|
+ // sp.ErrDescription += "列表页异常:\n 列表页共采集" + fmt.Sprint(sp.List_RunTimes) + "轮,其中有" + fmt.Sprint(sp.List_NoDataTimes) + "轮无数据\n"
|
|
|
|
+ //}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|