Browse Source

附件异常统计修改

maxiaoshan 2 years ago
parent
commit
2eb73bc99d
2 changed files with 27 additions and 26 deletions
  1. 26 25
      src/luatask/task.go
  2. 1 1
      src/timetask/report.go

+ 26 - 25
src/luatask/task.go

@@ -183,9 +183,9 @@ var (
 func StartTask() {
 	InitInfo() //初始化时间
 	logger.Debug(StartTime, EndTime, Publishtime)
-	GetCodeBaseInfo()              //初始化爬虫基本信息
-	GetBiddingCount()              //统计bidding表爬虫采集量
-	GetBiddingFileData()           //统计bidding_file附件大小为3.7 KB的信息
+	GetCodeBaseInfo() //初始化爬虫基本信息
+	GetBiddingCount() //统计bidding表爬虫采集量
+	//GetBiddingFileData()           //统计bidding_file附件大小为3.7 KB的信息
 	GetCodeHeart()                 //初始化爬虫心跳信息
 	GetSpiderHighListDownloadNum() //统计spider_highlistdata爬虫列表页下载量、下载失败量、未下载量
 	GetSpiderListDownloadNum()     //统计spider_listdata爬虫列表页下载量、下载失败量、未下载量
@@ -1072,33 +1072,34 @@ func GetSpiderWarnErrData() {
 			if level == 2 {
 				if infoText == "Field Value Not Contains Chinese" { //title、detail不含中文(数据分析处理每日异常数据)
 					stype = "text"
-				} else if infoText == "Publishtime Is Less Than Zero" { //发布时间小于0
+				} else if infoText == "Publishtime Is Error" { //发布时间小于0
 					stype = "publishtime"
 				} else if infoText == "Field Value Contains Random Code" { //title、detail含乱码
 					stype = "text"
 				}
 			} else if level == 1 {
-				if infoText == "Attachment Upload Failed" { //附件异常信息
-					flag := false
-					if data, ok := tmp["data"].(map[string]interface{}); ok {
-						if projectinfo, ok := data["projectinfo"].(map[string]interface{}); ok {
-							if attachments, ok := projectinfo["attachments"].(map[string]interface{}); ok {
-								for _, dataInfo := range attachments {
-									if d, ok := dataInfo.(map[string]interface{}); ok {
-										org_url := qu.ObjToString(d["org_url"])
-										if strings.HasSuffix(org_url, "javascript:void(0)") {
-											flag = true
-											break
-										}
-									}
-								}
-							}
-						}
-					}
-					if flag { //列入下载异常任务类型
-						infoText = "File Err" //infoText改为File Err,附件异常
-						stype = "annex"
-					}
+				if infoText == "File Size Or Url Error" { //附件异常信息
+					stype = "annex"
+					//flag := false
+					//if data, ok := tmp["data"].(map[string]interface{}); ok {
+					//	if projectinfo, ok := data["projectinfo"].(map[string]interface{}); ok {
+					//		if attachments, ok := projectinfo["attachments"].(map[string]interface{}); ok {
+					//			for _, dataInfo := range attachments {
+					//				if d, ok := dataInfo.(map[string]interface{}); ok {
+					//					org_url := qu.ObjToString(d["org_url"])
+					//					if strings.HasSuffix(org_url, "javascript:void(0)") {
+					//						flag = true
+					//						break
+					//					}
+					//				}
+					//			}
+					//		}
+					//	}
+					//}
+					//if flag { //列入下载异常任务类型
+					//	infoText = "File Err" //infoText改为File Err,附件异常
+					//	stype = "annex"
+					//}
 				} else if infoText == "Publishtime Is Zero" { //发布时间为0
 					stype = "publishtime"
 				}

+ 1 - 1
src/timetask/report.go

@@ -601,7 +601,7 @@ func SpiderWeeklyReportForLua() {
 	//维护爬虫总量
 	q := map[string]interface{}{
 		"comeintime": map[string]interface{}{
-			"$gte": util.GetTime(-4),
+			"$gte": util.GetTime(-6),
 			"$lte": time.Now().Unix(),
 		},
 		"types": "审核",