Skip to content

Commit a061764

Browse files
authored
Handle SIGINT and SIGTERM for nodejs process (#3148)
1 parent bb4c949 commit a061764

File tree

1 file changed

+7
-0
lines changed
  • src/Azure.Functions.Cli/npm/lib

1 file changed

+7
-0
lines changed

src/Azure.Functions.Cli/npm/lib/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ function main() {
1313
funcProc.on('exit', code => {
1414
process.exit(code);
1515
});
16+
17+
const exitHandler = (code) => {
18+
funcProc.kill(code);
19+
}
20+
21+
process.on('SIGINT', exitHandler);
22+
process.on('SIGTERM', exitHandler);
1623
}
1724

1825
main();

0 commit comments

Comments
 (0)