Skip to content

Commit

Permalink
修正退出
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed Apr 13, 2020
1 parent 67cc6f3 commit 0499218
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@typescript-eslint/parser": "^1.13.0",
"eslint": "^6.1.0",
"ts-node": "^8.3.0",
"typescript": "^3.5.3"
"typescript": "^3.8.3"
},
"npm": {
"publish": false
Expand Down
8 changes: 6 additions & 2 deletions src/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,12 @@ export class Cluster {

private async onConnectionError(err): Promise<void> {
console.error('cannot connect to server', err)
this.server.close(() => {
if (this.server) {
this.server.close(() => {
process.exit(1)
})
} else {
process.exit(1)
})
}
}
}

0 comments on commit 0499218

Please sign in to comment.