()
| 4877 | // ------------------------------------------------------------------ |
| 4878 | |
| 4879 | const close = () => |
| 4880 | Effect.gen(function* () { |
| 4881 | for (const runtime of runtimes.values()) { |
| 4882 | if (runtime.plugin.close) { |
| 4883 | yield* runtime.plugin |
| 4884 | .close() |
| 4885 | .pipe( |
| 4886 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 4887 | ); |
| 4888 | } |
| 4889 | } |
| 4890 | if (closeDb) { |
| 4891 | const out = closeDb(); |
| 4892 | if (Effect.isEffect(out)) { |
| 4893 | yield* out; |
| 4894 | } else if (out instanceof Promise) { |
| 4895 | yield* Effect.tryPromise({ |
| 4896 | try: () => out, |
| 4897 | catch: (cause) => |
| 4898 | new StorageError({ |
| 4899 | message: "Executor database close failed", |
| 4900 | cause, |
| 4901 | }), |
| 4902 | }); |
| 4903 | } |
| 4904 | } |
| 4905 | }); |
| 4906 | |
| 4907 | const base = { |
| 4908 | integrations: { |
no test coverage detected