@appweaver/core 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/application.js +4 -2
- package/package.json +1 -1
package/app/application.js
CHANGED
|
@@ -42,10 +42,12 @@ class Application extends lifecycle_manager_1.LifecycleManager {
|
|
|
42
42
|
await this.init();
|
|
43
43
|
Object.freeze(context_1.context);
|
|
44
44
|
// Add a termination handler for gracefully stopping the application
|
|
45
|
-
|
|
45
|
+
const shutdown = async () => {
|
|
46
46
|
await this.stop();
|
|
47
47
|
process.exit(0);
|
|
48
|
-
}
|
|
48
|
+
};
|
|
49
|
+
process.on('SIGTERM', shutdown);
|
|
50
|
+
process.on('SIGINT', shutdown);
|
|
49
51
|
// Add unhandled rejection handler
|
|
50
52
|
process.on('unhandledRejection', async (err) => {
|
|
51
53
|
common_1.logger.fatal(err, 'Unhandled rejection');
|