()
| 351 | // (openOwnedLocalDatabase) is. A stale/missing manifest only costs the nice |
| 352 | // message; the kernel lock still refuses a second owner. |
| 353 | const assertNoOtherActiveLocalServer = (): Effect.Effect< |
| 354 | void, |
| 355 | Error, |
| 356 | FileSystem.FileSystem | PlatformPath.Path |
| 357 | > => |
| 358 | Effect.gen(function* () { |
| 359 | const active = yield* readActiveLocalServerManifest(); |
| 360 | if (!active || active.pid === process.pid) return; |
| 361 | return yield* Effect.fail( |
| 362 | new Error( |
| 363 | [ |
| 364 | `A local Executor ${active.kind} is already running at ${active.connection.origin} (pid ${active.pid}).`, |
| 365 | `It owns the current data directory: ${active.dataDir}`, |
| 366 | "Stop it before starting another local server.", |
| 367 | ].join("\n"), |
| 368 | ), |
| 369 | ); |
| 370 | }); |
| 371 | |
| 372 | const takeOverActiveLocalServer = (input?: { |
| 373 | readonly onlyKind?: ExecutorLocalServerKind; |
no outgoing calls
no test coverage detected