From 461fa8e1319106b67f5452dbff8de26ce89187c6 Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 29 Aug 2023 23:29:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/cron.ts | 2 +- back/services/schedule.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/back/services/cron.ts b/back/services/cron.ts index 17c403b3..0e5a175a 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -434,7 +434,7 @@ export default class CronService { cp.on('exit', async (code, signal) => { this.logger.info( - `任务 ${command} 进程id: ${cp.pid} 退出,退出码 ${code}`, + `[panel][任务退出] 任务 ${command} 进程id: ${cp.pid}, 退出码 ${code}`, ); }); cp.on('close', async (code) => { diff --git a/back/services/schedule.ts b/back/services/schedule.ts index b6ff7d41..a17195dc 100644 --- a/back/services/schedule.ts +++ b/back/services/schedule.ts @@ -66,7 +66,7 @@ export default class ScheduleService { cp.stderr.on('data', async (data) => { this.logger.info( - '[执行任务失败] 命令: %s, 错误信息: %j', + '[panel][执行任务失败] 命令: %s, 错误信息: %j', command, data.toString(), ); @@ -75,7 +75,7 @@ export default class ScheduleService { cp.on('error', async (err) => { this.logger.error( - '[创建任务失败] 命令: %s, 错误信息: %j', + '[panel][创建任务失败] 命令: %s, 错误信息: %j', command, err, ); @@ -84,7 +84,7 @@ export default class ScheduleService { cp.on('exit', async (code, signal) => { this.logger.info( - `[任务退出] ${command} 进程id: ${cp.pid}, 退出码 ${code}`, + `[panel][任务退出] ${command} 进程id: ${cp.pid}, 退出码 ${code}`, ); }); @@ -98,8 +98,8 @@ export default class ScheduleService { resolve(null); }); } catch (error) { - await this.logger.error( - '[执行任务失败] 命令: %s, 错误信息: %j', + this.logger.error( + '[panel][执行任务失败] 命令: %s, 错误信息: %j', command, error, ); @@ -116,7 +116,7 @@ export default class ScheduleService { ) { const _id = this.formatId(id); this.logger.info( - '[创建cron任务], 任务ID: %s, cron: %s, 任务名: %s, 执行命令: %s', + '[panel][创建cron任务], 任务ID: %s, cron: %s, 任务名: %s, 执行命令: %s', _id, schedule, name, @@ -137,7 +137,7 @@ export default class ScheduleService { async cancelCronTask({ id = 0, name }: ScheduleTaskType) { const _id = this.formatId(id); - this.logger.info('[取消定时任务], 任务名: %s', name); + this.logger.info('[panel][取消定时任务], 任务名: %s', name); if (this.scheduleStacks.has(_id)) { this.scheduleStacks.get(_id)?.cancel(); this.scheduleStacks.delete(_id); @@ -152,7 +152,7 @@ export default class ScheduleService { ) { const _id = this.formatId(id); this.logger.info( - '[创建interval任务], 任务ID: %s, 任务名: %s, 执行命令: %s', + '[panel][创建interval任务], 任务ID: %s, 任务名: %s, 执行命令: %s', _id, name, command,