()
| 7002 | // ------------------------------------------------------------------ |
| 7003 | |
| 7004 | const close = () => |
| 7005 | Effect.gen(function* () { |
| 7006 | for (const runtime of runtimes.values()) { |
| 7007 | if (runtime.plugin.close) { |
| 7008 | yield* runtime.plugin |
| 7009 | .close() |
| 7010 | .pipe( |
| 7011 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 7012 | ); |
| 7013 | } |
| 7014 | } |
| 7015 | if (closeDb) { |
| 7016 | const out = closeDb(); |
| 7017 | if (Effect.isEffect(out)) { |
| 7018 | yield* out; |
| 7019 | } else if (out instanceof Promise) { |
| 7020 | yield* Effect.tryPromise({ |
| 7021 | try: () => out, |
| 7022 | catch: (cause) => |
| 7023 | new StorageError({ |
| 7024 | message: "Executor database close failed", |
| 7025 | cause, |
| 7026 | }), |
| 7027 | }); |
| 7028 | } |
| 7029 | } |
| 7030 | }); |
| 7031 | |
| 7032 | const base = { |
| 7033 | integrations: { |
no test coverage detected