Skip to content

Commit

Permalink
feat: Add SIGINT/SIGTERM handling and add close message
Browse files Browse the repository at this point in the history
The close message is configurable and the default message is written as
to assume that dimensions is not actually closing forever and is simply
going to be restarted.
  • Loading branch information
popstarfreas committed Feb 25, 2024
1 parent bffdae0 commit c9c12f9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
8 changes: 7 additions & 1 deletion app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ process.on('uncaughtException', function(e: any) {
errorLogging.appendLine(e.stack);
});

var dimensions = new Dimensions(logging);
var dimensions = new Dimensions(logging);
process.once('SIGTERM', () => {
dimensions.close();
})
process.once('SIGINT', () => {
dimensions.close();
})
14 changes: 13 additions & 1 deletion app/node_modules/dimensions/index.ts

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

7 changes: 7 additions & 0 deletions app/node_modules/dimensions/language.ts

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

3 changes: 1 addition & 2 deletions app/node_modules/dimensions/listenserver.ts

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

0 comments on commit c9c12f9

Please sign in to comment.