mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
撤销spawn修改
This commit is contained in:
parent
22a23fe05e
commit
6cd0feaace
|
@ -211,17 +211,18 @@ export default class CronService {
|
|||
cmdStr = `${cmdStr} now`;
|
||||
}
|
||||
|
||||
const cp = exec(cmdStr, (err, stdout, stderr) => {
|
||||
const cp = spawn(cmdStr, { shell: true, detached: true });
|
||||
this.cronDb.update(
|
||||
{ _id },
|
||||
{ $set: { status: CrontabStatus.running, pid: cp.pid } },
|
||||
);
|
||||
cp.on('close', (code) => {
|
||||
this.cronDb.update(
|
||||
{ _id },
|
||||
{ $set: { status: CrontabStatus.idle }, $unset: { pid: true } },
|
||||
);
|
||||
resolve();
|
||||
});
|
||||
this.cronDb.update(
|
||||
{ _id },
|
||||
{ $set: { status: CrontabStatus.running, pid: cp.pid } },
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user