From addd119edd8c1207fdfe53db59ba21d392d45aea Mon Sep 17 00:00:00 2001 From: marvzhang Date: Mon, 24 Feb 2020 09:30:48 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=BC=B9=E7=AA=97=E4=B8=AD=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E7=88=AC=E8=99=AB=E5=85=B6=E4=BB=96=E9=A1=B9=E4=B8=8D=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/schedule/ScheduleList.vue | 25 ++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/schedule/ScheduleList.vue b/frontend/src/views/schedule/ScheduleList.vue index 997488b8..63a3210b 100644 --- a/frontend/src/views/schedule/ScheduleList.vue +++ b/frontend/src/views/schedule/ScheduleList.vue @@ -27,13 +27,16 @@ :title="$t(dialogTitle)" :visible.sync="dialogVisible" width="640px" - :before-close="onDialogClose"> - + :before-close="onDialogClose" + > + @@ -62,6 +65,7 @@ :placeholder="$t('Spider')" filterable :disabled="isDisabledSpiderSchedule" + @change="onSpiderChange" > Date: Mon, 24 Feb 2020 09:32:12 +0800 Subject: [PATCH 2/8] updated CHANGELOG --- CHANGELOG-zh.md | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG-zh.md b/CHANGELOG-zh.md index 7c1cbdd8..bf091de3 100644 --- a/CHANGELOG-zh.md +++ b/CHANGELOG-zh.md @@ -9,6 +9,7 @@ - **复制爬虫**. 允许用户复制已存在爬虫来创建新爬虫. ### Bug 修复 +- **定时任务爬虫选择问题**. 字段不会随着爬虫变化而响应. # 0.4.6 (2020-02-13) ### 功能 / 优化 diff --git a/CHANGELOG.md b/CHANGELOG.md index bd2fc69c..4a044da4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - **Copy Spiders**. Allow users to copy an existing spider to create a new one. ### Bug Fixes +- **Schedule Spider Selection Issue**. Fields not responding to spider change. # 0.4.6 (2020-02-13) ### Features / Enhancement From a094d93d9576e8a6c3a8fd344b870617856af300 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Mon, 24 Feb 2020 09:38:54 +0800 Subject: [PATCH 3/8] updated CHANGELOG --- CHANGELOG-zh.md | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG-zh.md b/CHANGELOG-zh.md index bf091de3..03eaffe6 100644 --- a/CHANGELOG-zh.md +++ b/CHANGELOG-zh.md @@ -10,6 +10,7 @@ ### Bug 修复 - **定时任务爬虫选择问题**. 字段不会随着爬虫变化而响应. +- **定时任务冲突问题**. 两个不同的爬虫设置定时任务,时间设置成相同的话,可能会有bug. [#515](https://github.com/crawlab-team/crawlab/issues/515) [#565](https://github.com/crawlab-team/crawlab/issues/565) # 0.4.6 (2020-02-13) ### 功能 / 优化 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a044da4..142f3c72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - **Upgrade Check**. Check latest version and notifiy users to upgrade. - **Spiders Batch Operation**. Allow users to run/stop spider tasks and delete spiders in batches. - **Copy Spiders**. Allow users to copy an existing spider to create a new one. +- **Cron Jobs Conflict**. Possible bug when two spiders set to the same time of their cron jobs. [#515](https://github.com/crawlab-team/crawlab/issues/515) [#565](https://github.com/crawlab-team/crawlab/issues/565) ### Bug Fixes - **Schedule Spider Selection Issue**. Fields not responding to spider change. From a24eeab68d02f1931b6786d1191d28b8096ed438 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Mon, 24 Feb 2020 09:48:23 +0800 Subject: [PATCH 4/8] fixed https://github.com/crawlab-team/crawlab/issues/577 --- backend/services/task.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/services/task.go b/backend/services/task.go index 3bcdc8d6..f9bab5ce 100644 --- a/backend/services/task.go +++ b/backend/services/task.go @@ -313,13 +313,13 @@ func MakeLogDir(t model.Task) (fileDir string, err error) { } // 获取日志文件路径 -func GetLogFilePaths(fileDir string) (filePath string) { +func GetLogFilePaths(fileDir string, t model.Task) (filePath string) { // 时间戳 ts := time.Now() tsStr := ts.Format("20060102150405") // stdout日志文件 - filePath = filepath.Join(fileDir, tsStr+".log") + filePath = filepath.Join(fileDir, t.Id+"_"+tsStr+".log") return filePath } @@ -419,7 +419,7 @@ func ExecuteTask(id int) { return } // 获取日志文件路径 - t.LogPath = GetLogFilePaths(fileDir) + t.LogPath = GetLogFilePaths(fileDir, t) // 工作目录 cwd := filepath.Join( @@ -571,7 +571,7 @@ func GetTaskLog(id string) (logStr string, err error) { log.Errorf(err.Error()) } - fileP := GetLogFilePaths(fileDir) + fileP := GetLogFilePaths(fileDir, task) // 获取日志文件路径 fLog, err := os.Create(fileP) From 6b5c47aaf94a39e4ce27c007269686c2a200916d Mon Sep 17 00:00:00 2001 From: marvzhang Date: Mon, 24 Feb 2020 09:50:55 +0800 Subject: [PATCH 5/8] updated CHANGELOG --- CHANGELOG-zh.md | 1 + CHANGELOG.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-zh.md b/CHANGELOG-zh.md index 03eaffe6..a79b3eec 100644 --- a/CHANGELOG-zh.md +++ b/CHANGELOG-zh.md @@ -11,6 +11,7 @@ ### Bug 修复 - **定时任务爬虫选择问题**. 字段不会随着爬虫变化而响应. - **定时任务冲突问题**. 两个不同的爬虫设置定时任务,时间设置成相同的话,可能会有bug. [#515](https://github.com/crawlab-team/crawlab/issues/515) [#565](https://github.com/crawlab-team/crawlab/issues/565) +- **任务日志问题**. 在同一时间触发的不同任务可能会写入同一个日志文件. [#577](https://github.com/crawlab-team/crawlab/issues/577) # 0.4.6 (2020-02-13) ### 功能 / 优化 diff --git a/CHANGELOG.md b/CHANGELOG.md index 142f3c72..3502cdf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,11 @@ - **Upgrade Check**. Check latest version and notifiy users to upgrade. - **Spiders Batch Operation**. Allow users to run/stop spider tasks and delete spiders in batches. - **Copy Spiders**. Allow users to copy an existing spider to create a new one. -- **Cron Jobs Conflict**. Possible bug when two spiders set to the same time of their cron jobs. [#515](https://github.com/crawlab-team/crawlab/issues/515) [#565](https://github.com/crawlab-team/crawlab/issues/565) ### Bug Fixes - **Schedule Spider Selection Issue**. Fields not responding to spider change. +- **Cron Jobs Conflict**. Possible bug when two spiders set to the same time of their cron jobs. [#515](https://github.com/crawlab-team/crawlab/issues/515) [#565](https://github.com/crawlab-team/crawlab/issues/565) +- **Task Log Issue**. Different tasks write to the same log file if triggered at the same time. [#577](https://github.com/crawlab-team/crawlab/issues/577) # 0.4.6 (2020-02-13) ### Features / Enhancement From b5bef9fda0361045e3d918bc339b647bc9066ffc Mon Sep 17 00:00:00 2001 From: marvzhang Date: Mon, 24 Feb 2020 11:02:41 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AECron?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Cron/index.vue | 32 +++++++-- frontend/src/i18n/zh.js | 2 + frontend/src/views/schedule/ScheduleList.vue | 71 ++++++++++++++------ 3 files changed, 82 insertions(+), 23 deletions(-) diff --git a/frontend/src/components/Cron/index.vue b/frontend/src/components/Cron/index.vue index 642a2092..341a364d 100644 --- a/frontend/src/components/Cron/index.vue +++ b/frontend/src/components/Cron/index.vue @@ -6,6 +6,10 @@ z-index: 1; } + .cron-wrapper { + margin-bottom: 10px; + } + .el-tabs { box-shadow: none; } @@ -41,7 +45,14 @@