@honor-claw/yoyo 1.2.0-beta.10 → 1.2.0-beta.11
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/package.json +1 -1
- package/src/cloud-channel/client.ts +1 -22
package/package.json
CHANGED
|
@@ -26,7 +26,6 @@ export class ClawCloudSocketClient {
|
|
|
26
26
|
private retryTimer: NodeJS.Timeout | null = null;
|
|
27
27
|
private isManualClose = false;
|
|
28
28
|
private isRetryPaused = false; // 重试状态
|
|
29
|
-
private hasRetried = false;
|
|
30
29
|
// ping/pong 配置
|
|
31
30
|
private pingTimer: NodeJS.Timeout | null = null;
|
|
32
31
|
// 当前连接上下文
|
|
@@ -76,7 +75,6 @@ export class ClawCloudSocketClient {
|
|
|
76
75
|
this.isManualClose = false;
|
|
77
76
|
this.retryCount = 0;
|
|
78
77
|
this.isRetryPaused = false;
|
|
79
|
-
this.hasRetried = false;
|
|
80
78
|
|
|
81
79
|
this.startPingTimer();
|
|
82
80
|
|
|
@@ -257,25 +255,7 @@ export class ClawCloudSocketClient {
|
|
|
257
255
|
|
|
258
256
|
this.clearRetryTimer();
|
|
259
257
|
|
|
260
|
-
//
|
|
261
|
-
if (!this.hasRetried) {
|
|
262
|
-
this.hasRetried = true;
|
|
263
|
-
useClawLogger().info(`[claw-cloud-socket] first retry, reconnecting immediately`);
|
|
264
|
-
|
|
265
|
-
this.options.onStatusEvent?.({
|
|
266
|
-
type: StatusEventType.CLOUD_SOCKET_RETRY,
|
|
267
|
-
timestamp: Date.now(),
|
|
268
|
-
data: {
|
|
269
|
-
retryCount: this.retryCount,
|
|
270
|
-
delay: 0,
|
|
271
|
-
},
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
this.connect(true);
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// 后续重试使用指数退避: 1s → 2s → 4s,封顶4s无限重试
|
|
258
|
+
// 使用指数退避重试: 1s → 2s → 4s,封顶4s无限重试
|
|
279
259
|
const delay = this.calculateRetryDelay();
|
|
280
260
|
this.retryCount = Math.min(this.retryCount + 1, RETRY_COUNT_CAP);
|
|
281
261
|
|
|
@@ -365,7 +345,6 @@ export class ClawCloudSocketClient {
|
|
|
365
345
|
|
|
366
346
|
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
|
367
347
|
this.retryCount = 0;
|
|
368
|
-
this.hasRetried = false;
|
|
369
348
|
this.connect(true);
|
|
370
349
|
}
|
|
371
350
|
}
|