com.jimuwd.xian.registry-proxy 1.0.126 → 1.0.128
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/dist/gracefullShutdown.js +6 -6
- package/dist/port.js +3 -3
- package/package.json +1 -1
|
@@ -20,15 +20,15 @@ async function doCleanup() {
|
|
|
20
20
|
await deletePortFile();
|
|
21
21
|
}
|
|
22
22
|
// 捕获信号或异常
|
|
23
|
-
process.on('SIGINT', () => {
|
|
23
|
+
process.on('SIGINT', async () => {
|
|
24
24
|
logger.info('收到 SIGINT(Ctrl+C)');
|
|
25
|
-
|
|
25
|
+
await gracefulShutdown();
|
|
26
26
|
});
|
|
27
|
-
process.on('SIGTERM', () => {
|
|
27
|
+
process.on('SIGTERM', async () => {
|
|
28
28
|
logger.info('收到 SIGTERM');
|
|
29
|
-
|
|
29
|
+
await gracefulShutdown();
|
|
30
30
|
});
|
|
31
|
-
process.on('uncaughtException', (err) => {
|
|
31
|
+
process.on('uncaughtException', async (err) => {
|
|
32
32
|
logger.info('uncaughtException:', err);
|
|
33
|
-
|
|
33
|
+
await gracefulShutdown();
|
|
34
34
|
});
|
package/dist/port.js
CHANGED
|
@@ -13,14 +13,14 @@ export const deletePortFile = async () => {
|
|
|
13
13
|
async function deleteFile(filePath) {
|
|
14
14
|
try {
|
|
15
15
|
await unlink(filePath);
|
|
16
|
-
|
|
16
|
+
logger.info(`端口文件 ${basename(filePath)} 已删除`);
|
|
17
17
|
}
|
|
18
18
|
catch (err) {
|
|
19
19
|
if (err.code === 'ENOENT') {
|
|
20
|
-
|
|
20
|
+
logger.warn(`端口文件 ${filePath} 不存在`);
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
|
-
|
|
23
|
+
logger.error(`端口文件 ${filePath} 删除失败:`, err.message);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|