()
| 5664 | // ------------------------------------------------------------------ |
| 5665 | |
| 5666 | const close = () => |
| 5667 | Effect.gen(function* () { |
| 5668 | for (const runtime of runtimes.values()) { |
| 5669 | if (runtime.plugin.close) { |
| 5670 | yield* runtime.plugin |
| 5671 | .close() |
| 5672 | .pipe( |
| 5673 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 5674 | ); |
| 5675 | } |
| 5676 | } |
| 5677 | if (closeDb) { |
| 5678 | const out = closeDb(); |
| 5679 | if (Effect.isEffect(out)) { |
| 5680 | yield* out; |
| 5681 | } else if (out instanceof Promise) { |
| 5682 | yield* Effect.tryPromise({ |
| 5683 | try: () => out, |
| 5684 | catch: (cause) => |
| 5685 | new StorageError({ |
| 5686 | message: "Executor database close failed", |
| 5687 | cause, |
| 5688 | }), |
| 5689 | }); |
| 5690 | } |
| 5691 | } |
| 5692 | }); |
| 5693 | |
| 5694 | const base = { |
| 5695 | integrations: { |
no test coverage detected