From 7b04a3ca71717bb024908a0526e005e18715b41b Mon Sep 17 00:00:00 2001 From: "Zhuohuan LI (CARPE DIEM)" Date: Sat, 12 Nov 2016 11:45:39 +0800 Subject: [PATCH] fix type --- src/puppet-web/browser.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/puppet-web/browser.ts b/src/puppet-web/browser.ts index 18bc0b20..a3f7225a 100644 --- a/src/puppet-web/browser.ts +++ b/src/puppet-web/browser.ts @@ -201,7 +201,7 @@ export class Browser extends EventEmitter { return } - public clean(kill = false): Promise { + public async clean(kill = false): Promise { const max = 30 const backoff = 100 @@ -213,6 +213,7 @@ export class Browser extends EventEmitter { pidList.forEach(pid => { try { process.kill(pid, 'SIGKILL') + process.kill(pid) } catch (e) { log.warn('PuppetWebBrowser', 'clean(kill=true) process.kill(%d, SIGKILL) exception: %s', pid, e.message) } @@ -249,7 +250,7 @@ export class Browser extends EventEmitter { }) } - public getBrowserPids(): Promise { + public getBrowserPids(): Promise { log.silly('PuppetWebBrowser', 'getBrowserPids()') const head = this.setting.head @@ -278,7 +279,7 @@ export class Browser extends EventEmitter { } let matchRegex = new RegExp(browserRe, 'i') - const pids: string[] = children.filter(child => { + const pids: number[] = children.filter(child => { log.silly('PuppetWebBrowser', 'getBrowserPids() child: %s', JSON.stringify(child)) // https://github.com/indexzero/ps-tree/issues/18 return matchRegex.test('' + child.COMMAND + child.COMM) -- GitLab