MCPcopy Index your code
hub / github.com/lightningpixel/modly / waitUntilReady

Method waitUntilReady

electron/main/python-bridge.ts:178–191  ·  view source on GitHub ↗
(maxRetries = 180, delayMs = 500)

Source from the content-addressed store, hash-verified

176 }
177
178 private async waitUntilReady(maxRetries = 180, delayMs = 500): Promise<void> {
179 for (let i = 0; i < maxRetries; i++) {
180 if (!this.process) throw new Error('FastAPI process exited unexpectedly during startup')
181 try {
182 await axios.get(`${API_BASE_URL}/health`, { timeout: 2000 })
183 this.ready = true
184 console.log('[PythonBridge] FastAPI is ready')
185 return
186 } catch {
187 await new Promise((r) => setTimeout(r, delayMs))
188 }
189 }
190 throw new Error('FastAPI did not start in time')
191 }
192
193 private resolvePythonExecutable(): string {
194 const userData = app.getPath('userData')

Callers 1

_startMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected