(baseUrl: string)
| 450 | }); |
| 451 | |
| 452 | const resolveDaemonTarget = (baseUrl: string) => |
| 453 | Effect.gen(function* () { |
| 454 | const parsed = yield* parseDaemonUrl(baseUrl); |
| 455 | const host = canonicalDaemonHost(parsed.hostname); |
| 456 | const scopeId = currentDaemonScopeId(); |
| 457 | const pointer = yield* readDaemonPointer({ hostname: host, scopeId }); |
| 458 | |
| 459 | if (pointer) { |
| 460 | const pointerUrl = daemonBaseUrl(pointer.hostname, pointer.port); |
| 461 | if (isPidAlive(pointer.pid) && (yield* isServerReachable(pointerUrl))) { |
| 462 | return { |
| 463 | baseUrl: pointerUrl, |
| 464 | hostname: pointer.hostname, |
| 465 | port: pointer.port, |
| 466 | scopeId, |
| 467 | fromPointer: true, |
| 468 | }; |
| 469 | } |
| 470 | |
| 471 | yield* cleanupPointer({ hostname: pointer.hostname, scopeId, port: pointer.port }); |
| 472 | } |
| 473 | |
| 474 | return { |
| 475 | baseUrl: daemonBaseUrl(host, parsed.port), |
| 476 | hostname: host, |
| 477 | port: parsed.port, |
| 478 | scopeId, |
| 479 | fromPointer: false, |
| 480 | }; |
| 481 | }); |
| 482 | |
| 483 | const waitForDaemonStartupTarget = (input: { |
| 484 | readonly requestedBaseUrl: string; |
no test coverage detected