Skip to content

Commit d47fdae

Browse files
return true from #killProcess if taskkill says there is no running instance of task
1 parent f477aea commit d47fdae

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/libraries/Executor.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@ class Executor {
4444

4545
if (os.platform() === 'win32') {
4646
const {error, stderr} = await this.#executeFile('taskkill', ['/pid', String(process.pid), '/t', '/f'])
47+
const message = error || stderr
4748

48-
if (!error && !stderr) {
49+
if (message) {
4950
return true
5051
}
5152

52-
this.logger.error(error || stderr)
53+
if (message.toString().includes('There is no running instance of the task')) {
54+
this.logger.warn('Called #killProcess and tried to kill mysqld process but taskkill could not because it is not running. Error received:', message)
55+
return true
56+
}
57+
58+
this.logger.error(message)
5359
return false
5460
}
5561

0 commit comments

Comments
 (0)