@yolo-croket-dev/core 1.4.53-slowquery.8 → 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.
|
@@ -149,9 +149,11 @@ let RPCInterceptor = class RPCInterceptor {
|
|
|
149
149
|
const reDeliveryCount = Number(message.properties.headers['x-delivery-count']) || 0; /** 몇번 재전달되었는지 */
|
|
150
150
|
const staticRetryCount = Number(options === null || options === void 0 ? void 0 : options.messageRetryCount) || 0; /** 최대 재시도 갯수 */
|
|
151
151
|
const method = content.pattern;
|
|
152
|
+
const correlationId = message.properties.correlationId;
|
|
152
153
|
const execInterceptor = {
|
|
153
154
|
method,
|
|
154
155
|
traceId: ((_a = content.data.param) === null || _a === void 0 ? void 0 : _a.traceId) || '-',
|
|
156
|
+
correlationId,
|
|
155
157
|
};
|
|
156
158
|
// const logParam = {
|
|
157
159
|
// traceId,
|
|
@@ -2,6 +2,7 @@ import { OnApplicationShutdown, OnModuleDestroy, OnApplicationBootstrap } from '
|
|
|
2
2
|
interface GracefulExecInterceptor {
|
|
3
3
|
method: string;
|
|
4
4
|
traceId?: string;
|
|
5
|
+
correlationId: string;
|
|
5
6
|
}
|
|
6
7
|
export declare class GracefulShutdownService implements OnApplicationShutdown, OnModuleDestroy, OnApplicationBootstrap {
|
|
7
8
|
private activeInterceptors;
|
|
@@ -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);
|
|
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);
|