Skip to content

Commit

Permalink
Don’t quit twice. Koenkk#1550
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed May 20, 2019
1 parent 18913a1 commit 6adfdac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ controller.start();
process.on('SIGINT', handleQuit);
process.on('SIGTERM', handleQuit);

let stopping = false;

function handleQuit() {
controller.stop(() => process.exit());
if (!stopping) {
stopping = true;
controller.stop(() => process.exit());
}
}

0 comments on commit 6adfdac

Please sign in to comment.