mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 07:16:08 +08:00
修改系统任务日志
This commit is contained in:
parent
4618a19c04
commit
461fa8e131
|
@ -434,7 +434,7 @@ export default class CronService {
|
||||||
|
|
||||||
cp.on('exit', async (code, signal) => {
|
cp.on('exit', async (code, signal) => {
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
`任务 ${command} 进程id: ${cp.pid} 退出,退出码 ${code}`,
|
`[panel][任务退出] 任务 ${command} 进程id: ${cp.pid}, 退出码 ${code}`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
cp.on('close', async (code) => {
|
cp.on('close', async (code) => {
|
||||||
|
|
|
@ -66,7 +66,7 @@ export default class ScheduleService {
|
||||||
|
|
||||||
cp.stderr.on('data', async (data) => {
|
cp.stderr.on('data', async (data) => {
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
'[执行任务失败] 命令: %s, 错误信息: %j',
|
'[panel][执行任务失败] 命令: %s, 错误信息: %j',
|
||||||
command,
|
command,
|
||||||
data.toString(),
|
data.toString(),
|
||||||
);
|
);
|
||||||
|
@ -75,7 +75,7 @@ export default class ScheduleService {
|
||||||
|
|
||||||
cp.on('error', async (err) => {
|
cp.on('error', async (err) => {
|
||||||
this.logger.error(
|
this.logger.error(
|
||||||
'[创建任务失败] 命令: %s, 错误信息: %j',
|
'[panel][创建任务失败] 命令: %s, 错误信息: %j',
|
||||||
command,
|
command,
|
||||||
err,
|
err,
|
||||||
);
|
);
|
||||||
|
@ -84,7 +84,7 @@ export default class ScheduleService {
|
||||||
|
|
||||||
cp.on('exit', async (code, signal) => {
|
cp.on('exit', async (code, signal) => {
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
`[任务退出] ${command} 进程id: ${cp.pid}, 退出码 ${code}`,
|
`[panel][任务退出] ${command} 进程id: ${cp.pid}, 退出码 ${code}`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -98,8 +98,8 @@ export default class ScheduleService {
|
||||||
resolve(null);
|
resolve(null);
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await this.logger.error(
|
this.logger.error(
|
||||||
'[执行任务失败] 命令: %s, 错误信息: %j',
|
'[panel][执行任务失败] 命令: %s, 错误信息: %j',
|
||||||
command,
|
command,
|
||||||
error,
|
error,
|
||||||
);
|
);
|
||||||
|
@ -116,7 +116,7 @@ export default class ScheduleService {
|
||||||
) {
|
) {
|
||||||
const _id = this.formatId(id);
|
const _id = this.formatId(id);
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
'[创建cron任务], 任务ID: %s, cron: %s, 任务名: %s, 执行命令: %s',
|
'[panel][创建cron任务], 任务ID: %s, cron: %s, 任务名: %s, 执行命令: %s',
|
||||||
_id,
|
_id,
|
||||||
schedule,
|
schedule,
|
||||||
name,
|
name,
|
||||||
|
@ -137,7 +137,7 @@ export default class ScheduleService {
|
||||||
|
|
||||||
async cancelCronTask({ id = 0, name }: ScheduleTaskType) {
|
async cancelCronTask({ id = 0, name }: ScheduleTaskType) {
|
||||||
const _id = this.formatId(id);
|
const _id = this.formatId(id);
|
||||||
this.logger.info('[取消定时任务], 任务名: %s', name);
|
this.logger.info('[panel][取消定时任务], 任务名: %s', name);
|
||||||
if (this.scheduleStacks.has(_id)) {
|
if (this.scheduleStacks.has(_id)) {
|
||||||
this.scheduleStacks.get(_id)?.cancel();
|
this.scheduleStacks.get(_id)?.cancel();
|
||||||
this.scheduleStacks.delete(_id);
|
this.scheduleStacks.delete(_id);
|
||||||
|
@ -152,7 +152,7 @@ export default class ScheduleService {
|
||||||
) {
|
) {
|
||||||
const _id = this.formatId(id);
|
const _id = this.formatId(id);
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
'[创建interval任务], 任务ID: %s, 任务名: %s, 执行命令: %s',
|
'[panel][创建interval任务], 任务ID: %s, 任务名: %s, 执行命令: %s',
|
||||||
_id,
|
_id,
|
||||||
name,
|
name,
|
||||||
command,
|
command,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user