mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修复ql update任务日志
This commit is contained in:
parent
e6869fefa4
commit
12216abcff
|
@ -168,10 +168,10 @@ export default class CronService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async runSingle(id: string): Promise<number> {
|
private async runSingle(id: string): Promise<number> {
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve: any) => {
|
||||||
const cron = await this.get(id);
|
const cron = await this.get(id);
|
||||||
if (cron.status !== CrontabStatus.queued) {
|
if (cron.status !== CrontabStatus.queued) {
|
||||||
resolve(0);
|
resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +228,12 @@ export default class CronService {
|
||||||
{ $set: { status: CrontabStatus.idle }, $unset: { pid: true } },
|
{ $set: { status: CrontabStatus.idle }, $unset: { pid: true } },
|
||||||
);
|
);
|
||||||
fs.appendFileSync(logFile, `\n执行结束...`);
|
fs.appendFileSync(logFile, `\n执行结束...`);
|
||||||
resolve(code);
|
resolve();
|
||||||
|
});
|
||||||
|
|
||||||
|
process.on('SIGINT', function () {
|
||||||
|
fs.appendFileSync(logFile, `\n执行结束...`);
|
||||||
|
resolve();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user