()
| 4764 | // ------------------------------------------------------------------ |
| 4765 | |
| 4766 | const close = () => |
| 4767 | Effect.gen(function* () { |
| 4768 | for (const runtime of runtimes.values()) { |
| 4769 | if (runtime.plugin.close) { |
| 4770 | yield* runtime.plugin |
| 4771 | .close() |
| 4772 | .pipe( |
| 4773 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 4774 | ); |
| 4775 | } |
| 4776 | } |
| 4777 | if (closeDb) { |
| 4778 | const out = closeDb(); |
| 4779 | if (Effect.isEffect(out)) { |
| 4780 | yield* out; |
| 4781 | } else if (out instanceof Promise) { |
| 4782 | yield* Effect.tryPromise({ |
| 4783 | try: () => out, |
| 4784 | catch: (cause) => |
| 4785 | new StorageError({ |
| 4786 | message: "Executor database close failed", |
| 4787 | cause, |
| 4788 | }), |
| 4789 | }); |
| 4790 | } |
| 4791 | } |
| 4792 | }); |
| 4793 | |
| 4794 | const base = { |
| 4795 | integrations: { |
no test coverage detected