panrouter 5.4.3 → 5.4.4

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/package.json +1 -1
  2. package/pool-worker.mjs +3 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panrouter",
3
- "version": "5.4.3",
3
+ "version": "5.4.4",
4
4
  "description": "让 Claude Code 免费使用 DeepSeek 等模型,无需 API Key",
5
5
  "type": "module",
6
6
  "bin": {
package/pool-worker.mjs CHANGED
@@ -178,6 +178,8 @@ function scheduleReconnect() {
178
178
 
179
179
  function handleUpgrade() {
180
180
  log("收到主控升级指令,开始升级...", "WARN");
181
+ // 设关闭标志,避免 ws.close → onclose → scheduleReconnect 启动重连
182
+ isShuttingDown = true;
181
183
  if (ws) {
182
184
  try { ws.close(1000, "Upgrading"); } catch {}
183
185
  ws = null;
@@ -222,6 +224,7 @@ function handleUpgrade() {
222
224
  }
223
225
 
224
226
  async function doRestart() {
227
+ isShuttingDown = false;
225
228
  const serverOk = await ensureServer();
226
229
  if (!serverOk) {
227
230
  log("代理服务重启失败", "ERR");