MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / applyHubProbeResult

Function applyHubProbeResult

app/src/modules/hub.js:341–364  ·  view source on GitHub ↗
(server, result)

Source from the content-addressed store, hash-verified

339}
340
341function applyHubProbeResult(server, result) {
342 const info = getHubProbeInfo(server.id);
343 info.lastProbeAt = Date.now();
344
345 if (result.ok) {
346 clearHubRetry(server.id);
347 info.status = 'online';
348 info.latencyMs = result.latencyMs;
349 info.lastSuccessAt = info.lastProbeAt;
350 info.consecutiveFailures = 0;
351 return;
352 }
353
354 info.consecutiveFailures += 1;
355 if (info.lastSuccessAt && info.consecutiveFailures < HUB_PROBE_FAILS_TO_OFFLINE) {
356 info.status = 'unstable';
357 scheduleHubRetry(server.id);
358 return;
359 }
360
361 clearHubRetry(server.id);
362 info.status = 'offline';
363 info.latencyMs = null;
364}
365
366async function runHubProbes(servers, { markUnknown = false } = {}) {
367 if (!servers.length) return;

Callers 1

runHubProbesFunction · 0.70

Calls 3

getHubProbeInfoFunction · 0.70
clearHubRetryFunction · 0.70
scheduleHubRetryFunction · 0.70

Tested by

no test coverage detected