Skip to content

Commit 26383d5

Browse files
committed
more codes
1 parent 03d3c1a commit 26383d5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

scripts/poller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ process.on('SIGINT', function () {
5555
process.exit();
5656
});
5757

58+
process.on('SIGTERM', function() {
59+
process.exit();
60+
})
61+
5862
function mapper(field) {
5963
return function(object) {
6064
return object[field];

server.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ function startPolling() {
8787
});
8888
startPolling();
8989
});
90+
91+
process.on('exit', function(code) {
92+
child.kill();
93+
})
94+
95+
process.on('SIGINT', function () {
96+
child.kill();
97+
});
98+
99+
process.on('SIGTERM', function() {
100+
child.kill();
101+
})
90102
}
91103

92104
startPolling();

0 commit comments

Comments
 (0)