Skip to content

Commit

Permalink
修复typescript类型错误
Browse files Browse the repository at this point in the history
  • Loading branch information
wangpeng.why committed Aug 26, 2022
1 parent d2590ed commit 3b33a7f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
8 changes: 1 addition & 7 deletions back/services/cron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } },
Expand Down
4 changes: 2 additions & 2 deletions back/services/notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions back/services/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3b33a7f

Please sign in to comment.