|
@@ -406,7 +406,13 @@ func (f *Front) SaveStep() {
|
|
|
param["spiderhistorymaxpage"] = f.OtherBase.SpiderHistoryMaxPage
|
|
|
qu.Debug(f.OtherBase.SpiderMoveEvent)
|
|
|
tmpEvent, err := strconv.Atoi(f.OtherBase.SpiderMoveEvent) //f.OtherBase.SpiderMoveEvent此处SpiderMoveEvent已不表示comm、bid,表示增量的节点
|
|
|
- if f.OtherBase.SpiderType == "history" { //爬虫类型是history的放到7000节点,并记录历史节点
|
|
|
+ checkLua := false
|
|
|
+ msg := "保存成功"
|
|
|
+ checkMsg := ""
|
|
|
+ if f.OtherBase.SpiderType == "history" { //爬虫类型是history的放到7000节点,并记录历史节点
|
|
|
+ if f.OtherBase.SpiderHistoryMaxPage > 500 { //新爬虫跑历史超过500页提醒新建复制爬虫
|
|
|
+ msg += "提醒,历史页过大,考虑复制爬虫!"
|
|
|
+ }
|
|
|
param["event"] = 7000
|
|
|
if err == nil {
|
|
|
param["incrementevent"] = tmpEvent //开发人员切换增量节点
|
|
@@ -429,8 +435,8 @@ func (f *Front) SaveStep() {
|
|
|
param["iscopycontent"] = f.StepRe3.Checked
|
|
|
//
|
|
|
param["listisfilter"] = ListFilterReg.MatchString(f.Step2.Expert) //列表页校验是否含“--关键词过滤”
|
|
|
- matchLua, msg := LuaTextCheck(f.Base.SpiderCode, f.Step2.Expert, f.Step3.Expert, f.Step2.Types, infoformat, model)
|
|
|
- if !matchLua {
|
|
|
+ checkLua, checkMsg = LuaTextCheck(f.Base.SpiderCode, f.Step2.Expert, f.Step3.Expert, f.Step2.Types, infoformat, model)
|
|
|
+ if !checkLua {
|
|
|
issave := spider.SaveSpider(code, param) //保存脚本
|
|
|
if issave {
|
|
|
for k, v := range *one {
|
|
@@ -439,12 +445,15 @@ func (f *Front) SaveStep() {
|
|
|
}
|
|
|
}
|
|
|
Wlog(f.Base.SpiderName, f.Base.SpiderCode, user, f.GetSession("userid").(string), "修改", param)
|
|
|
- rep["msg"] = "保存成功"
|
|
|
+ rep["msg"] = msg + checkMsg
|
|
|
+ rep["ok"] = true
|
|
|
} else {
|
|
|
rep["msg"] = "保存失败"
|
|
|
+ rep["ok"] = false
|
|
|
}
|
|
|
} else {
|
|
|
- rep["msg"] = "保存失败," + msg
|
|
|
+ rep["msg"] = "保存失败," + checkMsg
|
|
|
+ rep["ok"] = false
|
|
|
}
|
|
|
rep["code"] = util.Se.Encode2Hex(code)
|
|
|
f.ServeJson(rep)
|