()
| 6399 | // ------------------------------------------------------------------ |
| 6400 | |
| 6401 | const close = () => |
| 6402 | Effect.gen(function* () { |
| 6403 | for (const runtime of runtimes.values()) { |
| 6404 | if (runtime.plugin.close) { |
| 6405 | yield* runtime.plugin |
| 6406 | .close() |
| 6407 | .pipe( |
| 6408 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 6409 | ); |
| 6410 | } |
| 6411 | } |
| 6412 | if (closeDb) { |
| 6413 | const out = closeDb(); |
| 6414 | if (Effect.isEffect(out)) { |
| 6415 | yield* out; |
| 6416 | } else if (out instanceof Promise) { |
| 6417 | yield* Effect.tryPromise({ |
| 6418 | try: () => out, |
| 6419 | catch: (cause) => |
| 6420 | new StorageError({ |
| 6421 | message: "Executor database close failed", |
| 6422 | cause, |
| 6423 | }), |
| 6424 | }); |
| 6425 | } |
| 6426 | } |
| 6427 | }); |
| 6428 | |
| 6429 | const base = { |
| 6430 | integrations: { |
no test coverage detected