()
| 365 | // (openOwnedLocalDatabase) is. A stale/missing manifest only costs the nice |
| 366 | // message; the kernel lock still refuses a second owner. |
| 367 | const assertNoOtherActiveLocalServer = (): Effect.Effect< |
| 368 | void, |
| 369 | Error, |
| 370 | FileSystem.FileSystem | PlatformPath.Path |
| 371 | > => |
| 372 | Effect.gen(function* () { |
| 373 | const active = yield* readActiveLocalServerManifest(); |
| 374 | if (!active || active.pid === process.pid) return; |
| 375 | return yield* Effect.fail( |
| 376 | new Error( |
| 377 | [ |
| 378 | `A local Executor ${active.kind} is already running at ${active.connection.origin} (pid ${active.pid}).`, |
| 379 | `It owns the current data directory: ${active.dataDir}`, |
| 380 | "Stop it before starting another local server.", |
| 381 | ].join("\n"), |
| 382 | ), |
| 383 | ); |
| 384 | }); |
| 385 | |
| 386 | const takeOverActiveLocalServer = (input?: { |
| 387 | readonly onlyKind?: ExecutorLocalServerKind; |
no outgoing calls
no test coverage detected