MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / updateLocalAvailability

Function updateLocalAvailability

scripts/studio-provider-bridge.mjs:215–235  ·  view source on GitHub ↗
(metadata)

Source from the content-addressed store, hash-verified

213}
214
215function updateLocalAvailability(metadata) {
216 if (stopped) {
217 return;
218 }
219 if (metadata.ok) {
220 localUnavailableSince = 0;
221 return;
222 }
223 localUnavailableSince ||= Date.now();
224 const elapsed = Date.now() - localUnavailableSince;
225 if (Date.now() - lastLocalUnavailableLogAt >= localUnavailableLogIntervalMs) {
226 lastLocalUnavailableLogAt = Date.now();
227 console.error(
228 `[simdeck-provider-bridge] local SimDeck HTTP unavailable for ${elapsed}ms while service supervisor is still running; keeping Studio bridge alive.`,
229 );
230 if (metadata.failureReason) {
231 console.error(`[simdeck-provider-bridge] ${metadata.failureReason}`);
232 }
233 printRecentServiceLog();
234 }
235}
236
237function processIsRunning(pid) {
238 try {

Callers 2

registerProviderFunction · 0.85
handleLocalProxyFailureFunction · 0.85

Calls 2

printRecentServiceLogFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected