(baseUrl: string)
| 436 | }); |
| 437 | |
| 438 | const resolveDaemonTarget = (baseUrl: string) => |
| 439 | Effect.gen(function* () { |
| 440 | const parsed = yield* parseDaemonUrl(baseUrl); |
| 441 | const host = canonicalDaemonHost(parsed.hostname); |
| 442 | const scopeId = currentDaemonScopeId(); |
| 443 | const pointer = yield* readDaemonPointer({ hostname: host, scopeId }); |
| 444 | |
| 445 | if (pointer) { |
| 446 | const pointerUrl = daemonBaseUrl(pointer.hostname, pointer.port); |
| 447 | if (isPidAlive(pointer.pid) && (yield* isServerReachable(pointerUrl))) { |
| 448 | return { |
| 449 | baseUrl: pointerUrl, |
| 450 | hostname: pointer.hostname, |
| 451 | port: pointer.port, |
| 452 | scopeId, |
| 453 | fromPointer: true, |
| 454 | }; |
| 455 | } |
| 456 | |
| 457 | yield* cleanupPointer({ hostname: pointer.hostname, scopeId, port: pointer.port }); |
| 458 | } |
| 459 | |
| 460 | return { |
| 461 | baseUrl: daemonBaseUrl(host, parsed.port), |
| 462 | hostname: host, |
| 463 | port: parsed.port, |
| 464 | scopeId, |
| 465 | fromPointer: false, |
| 466 | }; |
| 467 | }); |
| 468 | |
| 469 | const waitForDaemonStartupTarget = (input: { |
| 470 | readonly requestedBaseUrl: string; |
no test coverage detected