diff --git a/back/services/cron.ts b/back/services/cron.ts index 2e25881e..c114434a 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -325,16 +325,10 @@ export default class CronService { cp.on('exit', async (code, signal) => { this.logger.info( - `${command} pid: ${cp.pid} exit ${code} signal ${signal}`, + `任务 ${command} 进程id: ${cp.pid} 退出,退出码 ${code}`, ); - await CrontabModel.update( - { status: CrontabStatus.idle, pid: undefined }, - { where: { id } }, - ); - resolve(); }); cp.on('close', async (code) => { - this.logger.info(`${command} pid: ${cp.pid} closed ${code}`); await CrontabModel.update( { status: CrontabStatus.idle, pid: undefined }, { where: { id } }, diff --git a/back/services/notify.ts b/back/services/notify.ts index 282a69dd..fac042be 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -245,7 +245,7 @@ export default class NotificationService { const [corpid, corpsecret, touser, agentid, thumb_media_id = '1'] = weWorkAppKey.split(','); const url = `https://qyapi.weixin.qq.com/cgi-bin/gettoken`; - const { access_token } = await got + const tokenRes: any = await got .post(url, { timeout: this.timeout, retry: 0, @@ -296,7 +296,7 @@ export default class NotificationService { const res: any = await got .post( - `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${access_token}`, + `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${tokenRes.access_token}`, { timeout: this.timeout, retry: 0, diff --git a/back/services/schedule.ts b/back/services/schedule.ts index acfb9530..0703a7ee 100644 --- a/back/services/schedule.ts +++ b/back/services/schedule.ts @@ -79,13 +79,12 @@ export default class ScheduleService { cp.on('exit', async (code, signal) => { this.logger.info( - `${command} pid: ${cp.pid} exit ${code} signal ${signal}`, + `任务 ${command} 进程id: ${cp.pid} 退出,退出码 ${code}`, ); }); cp.on('close', async (code) => { const endTime = dayjs(); - this.logger.info(`${command} pid: ${cp.pid} closed ${code}`); await callbacks.onEnd?.( cp, endTime, diff --git a/package.json b/package.json index 5e476bd0..280ecf59 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,7 @@ "react-split-pane": "^0.1.92", "sockjs-client": "^1.6.0", "ts-node": "^10.6.0", + "tslib": "^2.4.0", "typescript": "^4.6.2", "umi": "^3.5.21", "umi-request": "^1.4.0",