()
| 4965 | // ------------------------------------------------------------------ |
| 4966 | |
| 4967 | const close = () => |
| 4968 | Effect.gen(function* () { |
| 4969 | for (const runtime of runtimes.values()) { |
| 4970 | if (runtime.plugin.close) { |
| 4971 | yield* runtime.plugin |
| 4972 | .close() |
| 4973 | .pipe( |
| 4974 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 4975 | ); |
| 4976 | } |
| 4977 | } |
| 4978 | if (closeDb) { |
| 4979 | const out = closeDb(); |
| 4980 | if (Effect.isEffect(out)) { |
| 4981 | yield* out; |
| 4982 | } else if (out instanceof Promise) { |
| 4983 | yield* Effect.tryPromise({ |
| 4984 | try: () => out, |
| 4985 | catch: (cause) => |
| 4986 | new StorageError({ |
| 4987 | message: "Executor database close failed", |
| 4988 | cause, |
| 4989 | }), |
| 4990 | }); |
| 4991 | } |
| 4992 | } |
| 4993 | }); |
| 4994 | |
| 4995 | const base = { |
| 4996 | integrations: { |
no test coverage detected