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.
@@ -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
- process.exit(0); // 触发 exit 事件
25
+ await gracefulShutdown();
26
26
  });
27
- process.on('SIGTERM', () => {
27
+ process.on('SIGTERM', async () => {
28
28
  logger.info('收到 SIGTERM');
29
- process.exit(0); // 触发 exit 事件
29
+ await gracefulShutdown();
30
30
  });
31
- process.on('uncaughtException', (err) => {
31
+ process.on('uncaughtException', async (err) => {
32
32
  logger.info('uncaughtException:', err);
33
- process.exit(1); // 触发 exit 事件
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
- console.log(`文件 ${basename(filePath)} 已删除`);
16
+ logger.info(`端口文件 ${basename(filePath)} 已删除`);
17
17
  }
18
18
  catch (err) {
19
19
  if (err.code === 'ENOENT') {
20
- console.log('文件不存在');
20
+ logger.warn(`端口文件 ${filePath} 不存在`);
21
21
  }
22
22
  else {
23
- console.error('删除失败:', err.message);
23
+ logger.error(`端口文件 ${filePath} 删除失败:`, err.message);
24
24
  }
25
25
  }
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "com.jimuwd.xian.registry-proxy",
3
- "version": "1.0.126",
3
+ "version": "1.0.128",
4
4
  "description": "A lightweight npm registry proxy with fallback support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",