sm-utility 2.4.19 → 2.4.21
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.
|
@@ -36,7 +36,7 @@ function LogMethod(options) {
|
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
const result = await originalMethod.apply(this, args);
|
|
39
|
-
if (result.error) {
|
|
39
|
+
if (result && result.error) {
|
|
40
40
|
handleError(result.error, className, propertyKey, metadata, params);
|
|
41
41
|
return result;
|
|
42
42
|
}
|
|
@@ -47,7 +47,9 @@ function LogMethod(options) {
|
|
|
47
47
|
result: (options === null || options === void 0 ? void 0 : options.logReturn) ? result : undefined,
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
if (result) {
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
51
53
|
}
|
|
52
54
|
catch (error) {
|
|
53
55
|
handleError(error, className, propertyKey, metadata, params);
|
|
@@ -107,18 +107,18 @@ class GracefulShutdownManager {
|
|
|
107
107
|
initiateShutdown(signal) {
|
|
108
108
|
// Prevent multiple shutdown attempts
|
|
109
109
|
if (this.isShuttingDown) {
|
|
110
|
-
logger_1.logger.info(`🔌 Additional ${signal} received, already shutting down...`);
|
|
111
110
|
return;
|
|
112
111
|
}
|
|
113
112
|
this.isShuttingDown = true;
|
|
114
113
|
logger_1.logger.info(`🔌 Received ${signal}, shutting down...`);
|
|
115
114
|
// Safety timeout
|
|
116
115
|
setTimeout(() => {
|
|
117
|
-
logger_1.logger.info('
|
|
116
|
+
logger_1.logger.info('🔌🚨 Forcing process exit after graceful period timeout');
|
|
118
117
|
process.exit(this.ABNORMAL_EXIT_CODE);
|
|
119
118
|
}, this.maxGracefulPeriodMs);
|
|
120
119
|
this.processClosers(0, () => {
|
|
121
120
|
this.processDeferredClosers();
|
|
121
|
+
logger_1.logger.info('🔌✅ Shutdown process completed successfully, exiting process');
|
|
122
122
|
process.exit(this.SUCCESS_EXIT_CODE);
|
|
123
123
|
});
|
|
124
124
|
}
|