Skip to content

Commit

Permalink
Add terminations to exec
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Duplenskikh committed Jan 8, 2024
1 parent 644e9df commit 09724af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions node/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1508,8 +1508,8 @@ export function exec(tool: string, args: any, options?: trm.IExecOptions): Q.Pro
}
}

if (getBoolFeatureFlag("ENABLE_KILL_CHILD_PROCESS")) {
['SIGINT', 'SIGTERM'].forEach(x => {
if (getBoolFeatureFlag('ENABLE_KILL_CHILD_PROCESS')) {
['SIGINT', 'SIGTERM'].forEach((x: NodeJS.Signals) => {
tr.on(x, () => {
tr.killChildProcess(x);
});
Expand Down
4 changes: 2 additions & 2 deletions node/toolrunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1343,9 +1343,9 @@ export class ToolRunner extends events.EventEmitter {
* Used to close child process by sending SIGNINT signal.
* It allows executed script to have some additional logic on SIGINT, before exiting.
*/
public killChildProcess(): void {
public killChildProcess(signal?: number | NodeJS.Signals | undefined): void {
if (this.childProcess) {
this.childProcess.kill();
this.childProcess.kill(signal);
}
}
}
Expand Down

0 comments on commit 09724af

Please sign in to comment.