From 3f536b5062ec0baa61a8551c54a44d95d116bfed Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Wed, 11 Aug 2021 16:50:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=81=9C=E6=AD=A2=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=97=B6=E8=BF=9B=E7=A8=8B=E6=97=A0=E6=B3=95=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/cron.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/back/services/cron.ts b/back/services/cron.ts index 7273d666..726ab6e6 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -208,7 +208,6 @@ export default class CronService { } const pids = pid.match(/\d+/g); const killLogs = []; - this.logger.info(`需要杀死的进程:${JSON.stringify(pids.toString())}`); for (const id of pids) { const c = `kill -9 ${id}`; const { stdout, stderr } = await execAsync(c); @@ -219,8 +218,7 @@ export default class CronService { killLogs.push(stdout); } } - this.logger.info(`杀死的进程结果:${JSON.stringify(killLogs)}`); - return JSON.stringify(killLogs); + return killLogs.length > 0 ? killLogs : ''; } catch (e) { return JSON.stringify(e); }