MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / isRunning

Method isRunning

src/cli/daemon-client.ts:322–352  ·  view source on GitHub ↗

* Check if daemon is running by attempting to connect.

()

Source from the content-addressed store, hash-verified

320 * Check if daemon is running by attempting to connect.
321 */
322 async isRunning(): Promise<boolean> {
323 return new Promise<boolean>((resolve) => {
324 const socket = net.createConnection(this.socketPath);
325 let settled = false;
326
327 const finish = (value: boolean): void => {
328 if (settled) return;
329 settled = true;
330 try {
331 socket.destroy();
332 } catch {
333 // ignore
334 }
335 resolve(value);
336 };
337
338 const timeoutId = setTimeout(() => {
339 finish(false);
340 }, this.timeout);
341
342 socket.on('connect', () => {
343 clearTimeout(timeoutId);
344 finish(true);
345 });
346
347 socket.on('error', () => {
348 clearTimeout(timeoutId);
349 finish(false);
350 });
351 });
352 }
353}

Callers 5

ensureDaemonRunningFunction · 0.95
handleStartFunction · 0.95
invokeViaDaemonMethod · 0.95
handleRestartFunction · 0.80

Calls 1

finishFunction · 0.50

Tested by

no test coverage detected