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