mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-24 07:16:08 +08:00
修复强制停止任务
This commit is contained in:
parent
092222b4cb
commit
633fe7707c
|
@ -186,7 +186,10 @@ export default class CronService {
|
||||||
|
|
||||||
cmd.on('exit', (code: number, signal: any) => {
|
cmd.on('exit', (code: number, signal: any) => {
|
||||||
this.logger.silly(`cmd exit ${code}`);
|
this.logger.silly(`cmd exit ${code}`);
|
||||||
this.cronDb.update({ _id }, { $set: { status: CrontabStatus.idle } });
|
this.cronDb.update(
|
||||||
|
{ _id },
|
||||||
|
{ $set: { status: CrontabStatus.idle }, $unset: { pid: true } },
|
||||||
|
);
|
||||||
fs.appendFileSync(logFile, `\n\n执行结束...`);
|
fs.appendFileSync(logFile, `\n\n执行结束...`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -99,12 +99,12 @@ const Crontab = () => {
|
||||||
align: 'center' as const,
|
align: 'center' as const,
|
||||||
render: (text: string, record: any) => (
|
render: (text: string, record: any) => (
|
||||||
<>
|
<>
|
||||||
{record.status === CrontabStatus.idle && (
|
{record.status !== CrontabStatus.disabled && !record.pid && (
|
||||||
<Tag icon={<ClockCircleOutlined />} color="default">
|
<Tag icon={<ClockCircleOutlined />} color="default">
|
||||||
空闲中
|
空闲中
|
||||||
</Tag>
|
</Tag>
|
||||||
)}
|
)}
|
||||||
{record.status === CrontabStatus.running && (
|
{record.status === CrontabStatus.running && record.pid && (
|
||||||
<Tag icon={<SyncOutlined spin />} color="processing">
|
<Tag icon={<SyncOutlined spin />} color="processing">
|
||||||
运行中
|
运行中
|
||||||
</Tag>
|
</Tag>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user