Skip to content

Commit

Permalink
Handle signals properly so CTRL-C exits container
Browse files Browse the repository at this point in the history
Based on this issue:

 - nodejs/node#4182

This is the proposed explanation and fix:

 - nodejs/node-v0.x-archive#9131 (comment)
  • Loading branch information
Mike Long authored Sep 28, 2016
1 parent 8e8e9d7 commit 686338a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inventoryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ client.set("books_count", "123", redis.print);
client.get("books_count", function (err, reply) {
console.log('books_count = ' + reply.toString());
});

process.on('SIGINT', function() {
process.exit();
});

0 comments on commit 686338a

Please sign in to comment.