()
| 7239 | // ------------------------------------------------------------------ |
| 7240 | |
| 7241 | const close = () => |
| 7242 | Effect.gen(function* () { |
| 7243 | for (const runtime of runtimes.values()) { |
| 7244 | if (runtime.plugin.close) { |
| 7245 | yield* runtime.plugin |
| 7246 | .close() |
| 7247 | .pipe( |
| 7248 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 7249 | ); |
| 7250 | } |
| 7251 | } |
| 7252 | if (closeDb) { |
| 7253 | const out = closeDb(); |
| 7254 | if (Effect.isEffect(out)) { |
| 7255 | yield* out; |
| 7256 | } else if (out instanceof Promise) { |
| 7257 | yield* Effect.tryPromise({ |
| 7258 | try: () => out, |
| 7259 | catch: (cause) => |
| 7260 | new StorageError({ |
| 7261 | message: "Executor database close failed", |
| 7262 | cause, |
| 7263 | }), |
| 7264 | }); |
| 7265 | } |
| 7266 | } |
| 7267 | }); |
| 7268 | |
| 7269 | const base = { |
| 7270 | integrations: { |
no test coverage detected