MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / startLauncherHealthMonitor

Function startLauncherHealthMonitor

desktop/main.mjs:322–341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

320}
321
322function startLauncherHealthMonitor() {
323 if (launcherHealthTimer) {
324 return
325 }
326
327 launcherHealthTimer = setInterval(async () => {
328 if (restartingLauncher || !mainWindow || mainWindow.isDestroyed()) {
329 return
330 }
331
332 try {
333 const response = await fetch(`${uiUrl}/api/state`)
334 if (!response.ok) {
335 throw new Error(`Host returned ${response.status}`)
336 }
337 } catch {
338 await restartLauncher('Local host was unreachable. Restarting it now...')
339 }
340 }, 5000)
341}
342
343function stopLauncherHealthMonitor() {
344 if (launcherHealthTimer) {

Callers 1

createMainWindowFunction · 0.85

Calls 1

restartLauncherFunction · 0.85

Tested by

no test coverage detected