|
@@ -77,7 +77,7 @@ type OtherBase struct {
|
|
|
IsFlow int //爬虫所采集数据是否参与数据流程标识
|
|
|
SpiderType string //爬虫类型:increment增量;history历史
|
|
|
SpiderHistoryMaxPage int //采集历史数据时的采集最大页
|
|
|
- SpiderMoveEvent string //爬虫采集完历史后要转移到的节点 comm:队列模式、bid:高性能模式、7700
|
|
|
+ SpiderMoveEvent string //爬虫采集完历史后要转移到的节点 comm:队列模式、bid:高性能模式
|
|
|
}
|
|
|
|
|
|
//加载某个爬虫
|
|
@@ -391,7 +391,7 @@ func (f *Front) SaveStep() {
|
|
|
param["spidertype"] = f.OtherBase.SpiderType
|
|
|
param["spiderhistorymaxpage"] = f.OtherBase.SpiderHistoryMaxPage
|
|
|
qu.Debug(f.OtherBase.SpiderMoveEvent)
|
|
|
- tmpEvent, err := strconv.Atoi(f.OtherBase.SpiderMoveEvent) //f.OtherBase.SpiderMoveEvent此处SpiderMoveEvent已不表示comm、bid、7700,表示增量的节点
|
|
|
+ tmpEvent, err := strconv.Atoi(f.OtherBase.SpiderMoveEvent) //f.OtherBase.SpiderMoveEvent此处SpiderMoveEvent已不表示comm、bid,表示增量的节点
|
|
|
if f.OtherBase.SpiderType == "history" { //爬虫类型是history的放到7000节点,并记录历史节点
|
|
|
param["event"] = 7000
|
|
|
if err == nil {
|
|
@@ -402,9 +402,7 @@ func (f *Front) SaveStep() {
|
|
|
} else if f.OtherBase.SpiderType == "increment" && err == nil { //增量
|
|
|
param["event"] = tmpEvent //开发人员切换增量节点
|
|
|
}
|
|
|
- if tmpEvent == 7700 {
|
|
|
- param["spidermovevent"] = "7700"
|
|
|
- } else if movevent, ok := util.Config.Uploadevents[f.OtherBase.SpiderMoveEvent].(string); ok && movevent != "" {
|
|
|
+ if movevent, ok := util.Config.Uploadevents[f.OtherBase.SpiderMoveEvent].(string); ok && movevent != "" {
|
|
|
param["spidermovevent"] = movevent
|
|
|
}
|
|
|
//开发人员修改爬虫节点后,在审核人员上架时,要在原来的节点下架,临时记录要下架的节点downevent
|
|
@@ -1280,6 +1278,7 @@ func UpStateAndUpSpider(code, id, reason, username string, state int) (bool, err
|
|
|
if state == Sp_state_3 {
|
|
|
types = "审核"
|
|
|
}
|
|
|
+ event := qu.IntAll((*one)["event"])
|
|
|
obj := map[string]interface{}{
|
|
|
"code": code,
|
|
|
"auditor": username,
|
|
@@ -1288,14 +1287,14 @@ func UpStateAndUpSpider(code, id, reason, username string, state int) (bool, err
|
|
|
"reason": reason,
|
|
|
"spideruser": (*one)["createuser"],
|
|
|
"modifytime": (*one)["modifytime"],
|
|
|
- "event": (*one)["event"],
|
|
|
+ "event": event,
|
|
|
"site": (*one)["site"],
|
|
|
"channel": (*one)["channel"],
|
|
|
}
|
|
|
if !strings.HasSuffix(code, u.Bu) { //凡是以_bu结尾的爬虫一律不计入审核记录
|
|
|
//新爬虫审核记录表
|
|
|
- if state == Sp_state_3 || state == Sp_state_2 {
|
|
|
- count := u.MgoEB.Count("lua_logs_auditor", map[string]interface{}{"code": code, "types": types})
|
|
|
+ if event == 7000 && (state == Sp_state_3 || state == Sp_state_2) {
|
|
|
+ count := u.MgoEB.Count("lua_logs_auditor", map[string]interface{}{"code": code, "types": "审核"})
|
|
|
if count == 0 { //新爬虫审核记录
|
|
|
u.MgoEB.Save("lua_logs_auditor_new", obj)
|
|
|
}
|
|
@@ -1620,7 +1619,7 @@ func (f *Front) Heart() {
|
|
|
code := qu.ObjToString(l["code"])
|
|
|
qu.Debug(code)
|
|
|
//d, _ := u.MgoE.FindOneByField("luaconfig", map[string]interface{}{"code": code}, map[string]interface{}{"state": 1, "param_common": 1, "str_list": 1, "type_list": 1})
|
|
|
- d, _ := u.MgoEB.FindOneByField("luaconfig", map[string]interface{}{"code": code}, map[string]interface{}{"state": 1, "param_common": 1, "str_list": 1, "type_list": 1})
|
|
|
+ d, _ := u.MgoEB.FindOneByField("luaconfig", map[string]interface{}{"code": code}, map[string]interface{}{"state": 1, "param_common": 1, "str_list": 1, "type_list": 1, "pendtime": 1})
|
|
|
l["state"] = (*d)["state"]
|
|
|
l["param_common"] = (*d)["param_common"]
|
|
|
if lt := qu.Int64All(l["list"]); lt != 0 {
|
|
@@ -1645,6 +1644,12 @@ func (f *Front) Heart() {
|
|
|
}
|
|
|
ut := qu.Int64All(l["updatetime"])
|
|
|
l["updatetime"] = qu.FormatDateByInt64(&ut, qu.Date_Full_Layout)
|
|
|
+ pendtime := qu.Int64All((*d)["pendtime"])
|
|
|
+ if pendtime != 0 {
|
|
|
+ l["pendtime"] = qu.FormatDateByInt64(&pendtime, qu.Date_Full_Layout)
|
|
|
+ } else {
|
|
|
+ l["pendtime"] = "0"
|
|
|
+ }
|
|
|
//l["isfindlist"] = "否"
|
|
|
//typeList := qu.IntAll((*d)["type_list"])
|
|
|
//strList := qu.ObjToString((*d)["str_list"])
|