@yolo-croket-dev/core 1.4.53-slowquery.9 → 1.4.53
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.
|
@@ -46,10 +46,9 @@ let GracefulShutdownService = class GracefulShutdownService {
|
|
|
46
46
|
}
|
|
47
47
|
popActiveInterceptors(execInterceptor) {
|
|
48
48
|
// eslint-disable-next-line max-len
|
|
49
|
-
this.activeInterceptors = this.activeInterceptors.filter((item) => item.method === execInterceptor.method && item.traceId === execInterceptor.traceId && item.correlationId === execInterceptor.correlationId);
|
|
49
|
+
this.activeInterceptors = this.activeInterceptors.filter((item) => !(item.method === execInterceptor.method && item.traceId === execInterceptor.traceId && item.correlationId === execInterceptor.correlationId));
|
|
50
50
|
}
|
|
51
51
|
async onApplicationShutdown(signal) {
|
|
52
|
-
console.debug(`GracefulShutdownService.onApplicationShutdown signal=${signal}`, { traceId: 'ON_APPLICATION_SHUTDOWN' });
|
|
53
52
|
msaLogger.debug(`GracefulShutdownService.onApplicationShutdown signal=${signal}`, { traceId: 'ON_APPLICATION_SHUTDOWN' });
|
|
54
53
|
process.exit(0);
|
|
55
54
|
}
|
|
@@ -58,16 +57,17 @@ let GracefulShutdownService = class GracefulShutdownService {
|
|
|
58
57
|
msaLogger.debug('GracefulShutdownService.onModuleDestroy', { traceId: 'ON_MODULE_DESTROY' });
|
|
59
58
|
// eslint-disable-next-line max-len
|
|
60
59
|
msaLogger.debug('GracefulShutdownService.onModuleDestroy activeInterceptors', { traceId: 'ON_MODULE_DESTROY' }, { activeInterceptors: this.activeInterceptors });
|
|
61
|
-
// eslint-disable-next-line max-len
|
|
62
|
-
console.debug('GracefulShutdownService.onModuleDestroy activeInterceptors', { traceId: 'ON_MODULE_DESTROY' }, { activeInterceptors: this.activeInterceptors });
|
|
63
60
|
let prevExecInterceptorCount = 0;
|
|
61
|
+
let count = 0;
|
|
64
62
|
while (this.activeInterceptors.length) {
|
|
65
|
-
|
|
63
|
+
count += 1;
|
|
64
|
+
if ((prevExecInterceptorCount !== this.activeInterceptors.length) || (count % 100 === 0)) {
|
|
66
65
|
prevExecInterceptorCount = this.activeInterceptors.length;
|
|
67
66
|
// eslint-disable-next-line max-len
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
msaLogger.debug('GracefulShutdownService.onModuleDestroy: waiting for interceptors to finish', { traceId: 'ON_MODULE_DESTROY' }, {
|
|
68
|
+
activeInterceptors: this.activeInterceptors,
|
|
69
|
+
count,
|
|
70
|
+
});
|
|
71
71
|
}
|
|
72
72
|
await new Promise((resolve) => {
|
|
73
73
|
setTimeout(resolve, 1000);
|