JeremyYao commented on PR #1277: URL: https://github.com/apache/daffodil-vscode/pull/1277#issuecomment-2996603565
Changing the bottom half of serverSTart() to ```Typescript try { const serverPid = await startServer( omegaEditPort, OMEGA_EDIT_HOST, getPidFile(omegaEditPort), logConfigFile ) clearInterval(animationIntervalId) if (serverPid === undefined || serverPid <= 0) { statusBarItem.dispose() throw new Error('Server failed to start or PID is invalid') } // this makes sure the server if fully online and ready to take requests statusBarItem.text = `Initializing Ωedit server on port ${omegaEditPort}` for (let i = 1; i <= 60; ++i) { try { await getServerInfo() break } catch (err) { statusBarItem.text = `Initializing Ωedit server on port ${omegaEditPort} (${i}/60)` } // wait 1 second before trying again await new Promise((resolve) => { setTimeout(() => { resolve(true) }, 1000) }) } try { serverInfo = await getServerInfo() } catch (err) { statusBarItem.dispose() await serverStop() throw new Error('Server failed to initialize') } statusBarItem.text = `Ωedit server on port ${omegaEditPort} initialized` const serverVersion = serverInfo.serverVersion // if the OS is not Windows, check that the server PID matches the one started // NOTE: serverPid is the PID of the server wrapper script on Windows if ( !os.platform().toLowerCase().startsWith('win') && serverInfo.serverProcessId !== serverPid ) { statusBarItem.dispose() throw new Error( `server PID mismatch ${serverInfo.serverProcessId} != ${serverPid}` ) } const clientVersion = getClientVersion() if (serverVersion !== clientVersion) { statusBarItem.dispose() throw new Error( `Server version ${serverVersion} and client version ${clientVersion} must match` ) } statusBarItem.text = `Ωedit server v${serverVersion} ready on port ${omegaEditPort} with PID ${serverInfo.serverProcessId}` setTimeout(() => { statusBarItem.dispose() }, 5000) } catch (err) { logError(err) } ``` results in the ```Typescript const serverPid = await startServer( omegaEditPort, OMEGA_EDIT_HOST, getPidFile(omegaEditPort), logConfigFile ) ``` call to hang. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@daffodil.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org