Skip to content

Commit

Permalink
fix: sleep 100ms to make sure SIGTERM send to the child processes (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored and popomore committed Aug 28, 2017
1 parent 48928ca commit da99744
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,6 @@ sudo: false
language: node_js
node_js:
- '6'
- '7'
- '8'
install:
- npm i npminstall && npminstall
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
@@ -1,7 +1,6 @@
environment:
matrix:
- nodejs_version: '6'
- nodejs_version: '7'
- nodejs_version: '8'

install:
Expand Down
8 changes: 6 additions & 2 deletions lib/master.js
Expand Up @@ -449,8 +449,12 @@ class Master extends EventEmitter {
// exit itself
this.killAppWorkers();
this.killAgentWorker();
this.log('[master] close done, exiting with code:0');
process.exit(0);
// sleep 100ms to make sure SIGTERM send to the child processes
this.log('[master] send kill SIGTERM to app workers and agent worker, will exit with code:0 after 100ms');
setTimeout(() => {
this.log('[master] close done, exiting with code:0');
process.exit(0);
}, 100);
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -61,6 +61,6 @@
"node": ">= 6.0.0"
},
"ci": {
"version": "6, 7, 8"
"version": "6, 8"
}
}

0 comments on commit da99744

Please sign in to comment.