mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +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) => {
|
||||
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执行结束...`);
|
||||
});
|
||||
|
||||
|
|
|
@ -99,12 +99,12 @@ const Crontab = () => {
|
|||
align: 'center' as const,
|
||||
render: (text: string, record: any) => (
|
||||
<>
|
||||
{record.status === CrontabStatus.idle && (
|
||||
{record.status !== CrontabStatus.disabled && !record.pid && (
|
||||
<Tag icon={<ClockCircleOutlined />} color="default">
|
||||
空闲中
|
||||
</Tag>
|
||||
)}
|
||||
{record.status === CrontabStatus.running && (
|
||||
{record.status === CrontabStatus.running && record.pid && (
|
||||
<Tag icon={<SyncOutlined spin />} color="processing">
|
||||
运行中
|
||||
</Tag>
|
||||
|
|
Loading…
Reference in New Issue
Block a user