|
@@ -553,7 +553,7 @@ func (f *Front) Importfile() {
|
|
|
o["status"] = 1
|
|
|
o["next"] = cells[4].Value
|
|
|
o["event"] = cells[5].Value
|
|
|
- o["historyevent"] = cells[6].Value
|
|
|
+ o["incrementevent"] = cells[6].Value
|
|
|
if cells[7].Value == "是" {
|
|
|
o["isflow"] = 1
|
|
|
} else {
|
|
@@ -686,13 +686,13 @@ func savelua(o map[string]interface{}) (bool, string) {
|
|
|
param["urgency"] = o["urgency"]
|
|
|
param["isflow"] = o["isflow"]
|
|
|
param["spidertype"] = "history"
|
|
|
- historyevent := qu.ObjToString(o["historyevent"])
|
|
|
- if movevent, ok := util.Config.Uploadevents[historyevent].(string); ok && movevent != "" {
|
|
|
+ incrementevent := qu.ObjToString(o["incrementevent"])
|
|
|
+ if movevent, ok := util.Config.Uploadevents[incrementevent].(string); ok && movevent != "" {
|
|
|
param["spidermovevent"] = movevent
|
|
|
} else {
|
|
|
param["spidermovevent"] = "7700"
|
|
|
}
|
|
|
- param["historyevent"] = qu.IntAll(o["historyevent"])
|
|
|
+ param["incrementevent"] = qu.IntAll(o["incrementevent"])
|
|
|
param["platform"] = o["platform"]
|
|
|
param["weight"] = o["weight"]
|
|
|
//默认字段
|
|
@@ -721,7 +721,7 @@ func savelua(o map[string]interface{}) (bool, string) {
|
|
|
"p_site": "",
|
|
|
"s_site": "",
|
|
|
"remarktime": time.Now().Unix(),
|
|
|
- "event": fmt.Sprint(historyevent),
|
|
|
+ "event": incrementevent,
|
|
|
"platform": o["platform"],
|
|
|
"spider_status": "0/1",
|
|
|
"updatetime": time.Now().Unix(),
|
|
@@ -957,8 +957,8 @@ func (f *Front) UpdateESP() {
|
|
|
} else if w == "state" { //无效爬虫改为待完成
|
|
|
tmpEvent := qu.IntAll((*one)["event"])
|
|
|
if one != nil && len(*one) > 0 {
|
|
|
- if (*one)["historyevent"] == nil && tmpEvent != 7000 { //除7000节点外没有historyevent的要重新设置
|
|
|
- set["historyevent"] = tmpEvent
|
|
|
+ if (*one)["incrementevent"] == nil && tmpEvent != 7000 { //除7000节点外没有incrementevent的要重新设置
|
|
|
+ set["incrementevent"] = tmpEvent
|
|
|
}
|
|
|
}
|
|
|
set["state"] = 0
|
|
@@ -1007,8 +1007,8 @@ func (f *Front) UpdateESP() {
|
|
|
b, err := spider.UpdateSpiderByCodeState(code, "6", qu.IntAll((*one)["event"])) //下架
|
|
|
if b && err == nil {
|
|
|
//历史节点下架为了避免线上运行爬虫待完成时改为7000采集历史,但是又转到其他平台,导致原线上运行节点爬虫并未下线,心跳异常
|
|
|
- if historyevent := (*one)["historyevent"]; historyevent != nil {
|
|
|
- b, err = spider.UpdateSpiderByCodeState(code, "6", qu.IntAll(historyevent))
|
|
|
+ if incrementevent := (*one)["incrementevent"]; incrementevent != nil {
|
|
|
+ b, err = spider.UpdateSpiderByCodeState(code, "6", qu.IntAll(incrementevent))
|
|
|
}
|
|
|
//关闭任务
|
|
|
u.MgoEB.Update("task", map[string]interface{}{"s_code": code, "i_state": map[string]interface{}{"$in": []int{0, 1, 2, 3, 5}}}, map[string]interface{}{"$set": map[string]interface{}{"i_state": 6}}, false, true)
|
|
@@ -1042,7 +1042,7 @@ func (f *Front) UpdateESP() {
|
|
|
} else { //修改节点
|
|
|
event, _ := strconv.Atoi(val)
|
|
|
set["event"] = event
|
|
|
- set["historyevent"] = event
|
|
|
+ set["incrementevent"] = event
|
|
|
//state := f.GetString("s")
|
|
|
//if state == "5" { //已上架状态改为下架
|
|
|
code := f.GetString("c")
|