()
| 4851 | // ------------------------------------------------------------------ |
| 4852 | |
| 4853 | const close = () => |
| 4854 | Effect.gen(function* () { |
| 4855 | for (const runtime of runtimes.values()) { |
| 4856 | if (runtime.plugin.close) { |
| 4857 | yield* runtime.plugin |
| 4858 | .close() |
| 4859 | .pipe( |
| 4860 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 4861 | ); |
| 4862 | } |
| 4863 | } |
| 4864 | if (closeDb) { |
| 4865 | const out = closeDb(); |
| 4866 | if (Effect.isEffect(out)) { |
| 4867 | yield* out; |
| 4868 | } else if (out instanceof Promise) { |
| 4869 | yield* Effect.tryPromise({ |
| 4870 | try: () => out, |
| 4871 | catch: (cause) => |
| 4872 | new StorageError({ |
| 4873 | message: "Executor database close failed", |
| 4874 | cause, |
| 4875 | }), |
| 4876 | }); |
| 4877 | } |
| 4878 | } |
| 4879 | }); |
| 4880 | |
| 4881 | const base = { |
| 4882 | integrations: { |
no test coverage detected