fix: 修复重连逻辑,确保在重连失败时保留尝试次数以继续重试链
This commit is contained in:
1 parent
dece143ef8
commit
cefa4cf35c
1 file changed
+6
@@ -872,7 +872,13 @@ export class ProcessManager {
|
||||
console.log(
|
||||
`[WS-Reconnect] ${new Date().toISOString()} | Process | reconnect_failed | attempt=${attempts}/${RECONNECT_MAX_ATTEMPTS}`,
|
||||
);
|
||||
// attach() zeroed the counter; restore so the retry chain continues
|
||||
// where it left off instead of restarting from attempt 1.
|
||||
if (this.wantConnection) {
|
||||
this.reconnectAttempts = attempts;
|
||||
}
|
||||
this.scheduleReconnect();
|
||||
return;
|
||||
}
|
||||
// Successful attach() zeros reconnectAttempts; restore so the open
|
||||
// handler can log reconnect_success and the back-off chain continues
|
||||
|
||||
Reference in new issue
Block a user