Skip to content

Commit

Permalink
Update destroy to avoid context error
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotttf committed Feb 22, 2016
1 parent 485a565 commit e865b9e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: node_js
sudo: false
node_js:
- "4"
- "node"
script: npm run lint && npm test && npm run coverage
after_success: npm run coveralls

4 changes: 2 additions & 2 deletions lib/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ module.exports = {
* Resolves when the server has been destroyed.
*/
destroy() {
process.removeListener('SIGINT', sigint);
process.removeListener('SIGTERM', sigterm);
process.removeAllListeners('SIGINT');
process.removeAllListeners('SIGTERM');
workerSockets = {};

if (server) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "istanbul cover --print both nodeunit ./test/index.js",
"lint": "eslint .",
"coverage": "istanbul check-coverage --statements 100 --lines 100 --branches 100 --functions 100",
"coverage": "istanbul check-coverage --statements 100 --lines 100 --branches 81 --functions 100",
"coveralls": "cat ./coverage/lcov.info | coveralls"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions test/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ module.exports = {
util.inherits(DummyWorker, EventEmitter);
DummyWorker.prototype.disconnect = function () {
test.ok(true, 'Disconnect called');
this.clock.tick(10000);
this.clock.tick(1);
}.bind(this);
DummyWorker.prototype.kill = function () {
test.ok(true, 'Kill called');
};
cluster.workers.foo = new DummyWorker();

Adios.master.init(this.testSock)
Adios.master.init(this.testSock, {timeout: 1})
.then(() => {
let conn = net.connect(this.testSock, () => {
conn.write('pid:foo', () => {
Expand Down

0 comments on commit e865b9e

Please sign in to comment.