mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-25 00:16:06 +08:00
修复无法停止任务
This commit is contained in:
parent
ef26dd847e
commit
b614d7ec7a
|
@ -134,7 +134,12 @@ export default class CronService {
|
|||
for (let i = 0; i < docs.length; i++) {
|
||||
const doc = docs[i];
|
||||
if (doc.pid) {
|
||||
exec(`kill -9 ${doc.pid}`);
|
||||
exec(`kill -9 ${doc.pid}`, (err, stdout, stderr) => {
|
||||
this.cronDb.update(
|
||||
{ _id: doc._id },
|
||||
{ $set: { status: CrontabStatus.idle }, $unset: { pid: true } },
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user