|
@@ -165,17 +165,8 @@ func (s *Spider) ExecJob(reload bool) {
|
|
logger.Error(s.Code, err)
|
|
logger.Error(s.Code, err)
|
|
}
|
|
}
|
|
if util.Config.IsHistoryEvent && s.GetVar("spiderType") == "history" { //判断爬虫是增量还是历史爬虫(目前只会在7000节点上有历史爬虫)
|
|
if util.Config.IsHistoryEvent && s.GetVar("spiderType") == "history" { //判断爬虫是增量还是历史爬虫(目前只会在7000节点上有历史爬虫)
|
|
- for _, as := range []sync.Map{Allspiders, Allspiders2} { //爬虫在该节点下架
|
|
|
|
- if tmp, ok := as.Load(s.Code); ok {
|
|
|
|
- sp, ok := tmp.(*Spider)
|
|
|
|
- if ok {
|
|
|
|
- sp.Stop = true
|
|
|
|
- sp.L.Close()
|
|
|
|
- as.Delete(s.Code)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- SpiderCodeSendToEditor(s.Code)
|
|
|
|
|
|
+ UpdateSpiderByCodeState(s.Code, "6") //爬虫在该节点下架
|
|
|
|
+ SpiderCodeSendToEditor(s.Code) //发送编辑器
|
|
return
|
|
return
|
|
} else {
|
|
} else {
|
|
if util.Config.Working == 0 { //高性能模式
|
|
if util.Config.Working == 0 { //高性能模式
|
|
@@ -189,8 +180,7 @@ func (s *Spider) ExecJob(reload bool) {
|
|
*/
|
|
*/
|
|
//if s.IsMustDownload { //历史数据下载,只跑一轮
|
|
//if s.IsMustDownload { //历史数据下载,只跑一轮
|
|
if s.IsHistoricalMend && util.Config.IsHistoryEvent { //历史节点7000,高性能模式,历史补漏只下载一轮
|
|
if s.IsHistoricalMend && util.Config.IsHistoryEvent { //历史节点7000,高性能模式,历史补漏只下载一轮
|
|
- s.Stop = true
|
|
|
|
- s.L.Close()
|
|
|
|
|
|
+ UpdateSpiderByCodeState(s.Code, "6") //爬虫在该节点下架
|
|
b := mgu.Update("luaconfig", "editor", "editor", map[string]interface{}{"code": s.Code}, map[string]interface{}{"$set": map[string]interface{}{"state": 6}}, false, false)
|
|
b := mgu.Update("luaconfig", "editor", "editor", map[string]interface{}{"code": s.Code}, map[string]interface{}{"$set": map[string]interface{}{"state": 6}}, false, false)
|
|
logger.Info("Delete History Code:", s.Code, b)
|
|
logger.Info("Delete History Code:", s.Code, b)
|
|
} else {
|
|
} else {
|