@wu529778790/open-im 1.10.9-beta.13 → 1.10.9-beta.14
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/dist/clawbot/client.js +6 -5
- package/package.json +1 -1
package/dist/clawbot/client.js
CHANGED
|
@@ -37,20 +37,21 @@ export async function initClawbot(config, eventHandler, onStateChange) {
|
|
|
37
37
|
stopped = false;
|
|
38
38
|
reconnectAttempt = 0;
|
|
39
39
|
lastUpdateId = 0;
|
|
40
|
-
// Verify connectivity
|
|
40
|
+
// Verify connectivity — non-fatal, reconnect loop will retry
|
|
41
41
|
try {
|
|
42
42
|
const res = await fetchApi('/ilink/bot/getupdates?timeout=1');
|
|
43
43
|
if (!res.ok) {
|
|
44
44
|
throw new Error(`API check failed: ${res.error ?? 'unknown'}`);
|
|
45
45
|
}
|
|
46
46
|
log.info(`ClawBot API reachable at ${apiUrl}`);
|
|
47
|
+
updateState('connected');
|
|
48
|
+
startPolling();
|
|
47
49
|
}
|
|
48
50
|
catch (err) {
|
|
49
|
-
log.
|
|
50
|
-
|
|
51
|
+
log.warn('ClawBot API not reachable, will retry:', err);
|
|
52
|
+
updateState('connecting');
|
|
53
|
+
scheduleReconnect();
|
|
51
54
|
}
|
|
52
|
-
updateState('connected');
|
|
53
|
-
startPolling();
|
|
54
55
|
log.info('ClawBot client initialized');
|
|
55
56
|
}
|
|
56
57
|
function startPolling() {
|