@wu529778790/open-im 1.11.1-beta.20 → 1.11.1-beta.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.
Files changed (2) hide show
  1. package/dist/index.js +11 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -330,8 +330,17 @@ export async function main() {
330
330
  await closeLogger();
331
331
  process.exit(0);
332
332
  };
333
- process.on("SIGINT", () => shutdown().catch(() => process.exit(1)));
334
- process.on("SIGTERM", () => shutdown().catch(() => process.exit(1)));
333
+ process.on("SIGINT", () => {
334
+ // 优雅关闭超时:10 秒后强制退出
335
+ const forceExit = setTimeout(() => { log.warn('Shutdown timeout, forcing exit'); process.exit(1); }, 10_000);
336
+ forceExit.unref();
337
+ shutdown().catch(() => process.exit(1));
338
+ });
339
+ process.on("SIGTERM", () => {
340
+ const forceExit = setTimeout(() => { log.warn('Shutdown timeout, forcing exit'); process.exit(1); }, 10_000);
341
+ forceExit.unref();
342
+ shutdown().catch(() => process.exit(1));
343
+ });
335
344
  // 兜底:进程退出(含异常路径,如未捕获异常 / SIGKILL)时强制清理 CLI 子进程,
336
345
  // 避免僵尸 / 孤儿。正常 shutdown 已在 cleanupAdapters() 里清理过。
337
346
  process.on("exit", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wu529778790/open-im",
3
- "version": "1.11.1-beta.20",
3
+ "version": "1.11.1-beta.21",
4
4
  "description": "Your AI coding assistant, in every chat app. Multi-platform IM bridge for Claude Code, Codex, and CodeBuddy.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",