@nxtedition/lib 17.0.0 → 17.0.1
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.js +10 -2
- package/package.json +1 -1
package/app.js
CHANGED
|
@@ -118,6 +118,10 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
118
118
|
{
|
|
119
119
|
const loggerConfig = { ...appConfig.logger, ...config.logger }
|
|
120
120
|
|
|
121
|
+
process.on('uncaughtExceptionMonitor', (err) => {
|
|
122
|
+
logger.fatal({ err }, 'uncaught exception')
|
|
123
|
+
})
|
|
124
|
+
|
|
121
125
|
logger = createLogger({
|
|
122
126
|
...loggerConfig,
|
|
123
127
|
name: serviceName,
|
|
@@ -160,11 +164,15 @@ export function makeApp(appConfig, onTerminate) {
|
|
|
160
164
|
}
|
|
161
165
|
|
|
162
166
|
setTimeout(() => {
|
|
163
|
-
process.
|
|
167
|
+
process.abort()
|
|
164
168
|
}, 10e3).unref()
|
|
165
169
|
}
|
|
166
170
|
|
|
167
|
-
process
|
|
171
|
+
process
|
|
172
|
+
.on('beforeExit', terminate)
|
|
173
|
+
.on('SIGINT', terminate)
|
|
174
|
+
.on('SIGTERM', terminate)
|
|
175
|
+
.on('uncaughtExceptionMonitor', terminate)
|
|
168
176
|
|
|
169
177
|
logger.debug({ data: JSON.stringify(config, null, 2) }, 'config')
|
|
170
178
|
|