mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
更新scrapy参数
This commit is contained in:
@@ -12,19 +12,20 @@ import (
|
||||
)
|
||||
|
||||
type Schedule struct {
|
||||
Id bson.ObjectId `json:"_id" bson:"_id"`
|
||||
Name string `json:"name" bson:"name"`
|
||||
Description string `json:"description" bson:"description"`
|
||||
SpiderId bson.ObjectId `json:"spider_id" bson:"spider_id"`
|
||||
Cron string `json:"cron" bson:"cron"`
|
||||
EntryId cron.EntryID `json:"entry_id" bson:"entry_id"`
|
||||
Param string `json:"param" bson:"param"`
|
||||
RunType string `json:"run_type" bson:"run_type"`
|
||||
NodeIds []bson.ObjectId `json:"node_ids" bson:"node_ids"`
|
||||
Status string `json:"status" bson:"status"`
|
||||
Enabled bool `json:"enabled" bson:"enabled"`
|
||||
UserId bson.ObjectId `json:"user_id" bson:"user_id"`
|
||||
ScrapySpider string `json:"scrapy_spider" bson:"scrapy_spider"`
|
||||
Id bson.ObjectId `json:"_id" bson:"_id"`
|
||||
Name string `json:"name" bson:"name"`
|
||||
Description string `json:"description" bson:"description"`
|
||||
SpiderId bson.ObjectId `json:"spider_id" bson:"spider_id"`
|
||||
Cron string `json:"cron" bson:"cron"`
|
||||
EntryId cron.EntryID `json:"entry_id" bson:"entry_id"`
|
||||
Param string `json:"param" bson:"param"`
|
||||
RunType string `json:"run_type" bson:"run_type"`
|
||||
NodeIds []bson.ObjectId `json:"node_ids" bson:"node_ids"`
|
||||
Status string `json:"status" bson:"status"`
|
||||
Enabled bool `json:"enabled" bson:"enabled"`
|
||||
UserId bson.ObjectId `json:"user_id" bson:"user_id"`
|
||||
ScrapySpider string `json:"scrapy_spider" bson:"scrapy_spider"`
|
||||
ScrapyLogLevel string `json:"scrapy_log_level" bson:"scrapy_log_level"`
|
||||
|
||||
// 前端展示
|
||||
SpiderName string `json:"spider_name" bson:"spider_name"`
|
||||
|
||||
@@ -38,8 +38,7 @@ func AddScheduleTask(s model.Schedule) func() {
|
||||
debug.PrintStack()
|
||||
return
|
||||
}
|
||||
|
||||
param = s.ScrapySpider + " " + s.Param
|
||||
param = s.ScrapySpider + " -L " + s.ScrapyLogLevel + " " + s.Param
|
||||
} else {
|
||||
param = s.Param
|
||||
}
|
||||
|
||||
@@ -466,9 +466,6 @@ export default {
|
||||
if (res) {
|
||||
const form = JSON.parse(JSON.stringify(this.scheduleForm))
|
||||
form.cron = '0 ' + this.scheduleForm.cron
|
||||
if (this.spiderForm.is_scrapy) {
|
||||
form.param += form.param + ' --loglevel=' + form.scrapy_log_level
|
||||
}
|
||||
if (this.isEdit) {
|
||||
request.post(`/schedules/${this.scheduleForm._id}`, form).then(response => {
|
||||
if (response.data.error) {
|
||||
|
||||
Reference in New Issue
Block a user