()
| 4034 | // ------------------------------------------------------------------ |
| 4035 | |
| 4036 | const close = () => |
| 4037 | Effect.gen(function* () { |
| 4038 | for (const runtime of runtimes.values()) { |
| 4039 | if (runtime.plugin.close) { |
| 4040 | yield* runtime.plugin |
| 4041 | .close() |
| 4042 | .pipe( |
| 4043 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 4044 | ); |
| 4045 | } |
| 4046 | } |
| 4047 | if (closeDb) { |
| 4048 | const out = closeDb(); |
| 4049 | if (Effect.isEffect(out)) { |
| 4050 | yield* out; |
| 4051 | } else if (out instanceof Promise) { |
| 4052 | yield* Effect.tryPromise({ |
| 4053 | try: () => out, |
| 4054 | catch: (cause) => |
| 4055 | new StorageError({ |
| 4056 | message: "Executor database close failed", |
| 4057 | cause, |
| 4058 | }), |
| 4059 | }); |
| 4060 | } |
| 4061 | } |
| 4062 | }); |
| 4063 | |
| 4064 | const base = { |
| 4065 | integrations: { |
no test coverage detected