Browse Source

更新平台时无历史节点下架失败造成更新失败修复

maxiaoshan 3 years ago
parent
commit
18b1e39c0f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/front/front.go

+ 3 - 1
src/front/front.go

@@ -896,7 +896,9 @@ func (f *Front) UpdateESP() {
 			b, err := spider.UpdateSpiderByCodeState(code, "6", qu.IntAll((*one)["event"])) //下架
 			if b && err == nil {
 				//历史节点下架为了避免线上运行爬虫待完成时改为7000采集历史,但是又转到其他平台,导致原线上运行节点爬虫并未下线,心跳异常
-				b, err = spider.UpdateSpiderByCodeState(code, "6", qu.IntAll((*one)["historyevent"]))
+				if historyevent := (*one)["historyevent"]; historyevent != nil {
+					b, err = spider.UpdateSpiderByCodeState(code, "6", qu.IntAll(historyevent))
+				}
 				if b && err == nil {
 					set["state"] = 0 //更新状态
 					set["luauser"] = map[string]interface{}{