()
| 3778 | // ------------------------------------------------------------------ |
| 3779 | |
| 3780 | const close = () => |
| 3781 | Effect.gen(function* () { |
| 3782 | for (const runtime of runtimes.values()) { |
| 3783 | if (runtime.plugin.close) { |
| 3784 | yield* runtime.plugin |
| 3785 | .close() |
| 3786 | .pipe( |
| 3787 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 3788 | ); |
| 3789 | } |
| 3790 | } |
| 3791 | if (closeDb) { |
| 3792 | const out = closeDb(); |
| 3793 | if (Effect.isEffect(out)) { |
| 3794 | yield* out; |
| 3795 | } else if (out instanceof Promise) { |
| 3796 | yield* Effect.tryPromise({ |
| 3797 | try: () => out, |
| 3798 | catch: (cause) => |
| 3799 | new StorageError({ |
| 3800 | message: "Executor database close failed", |
| 3801 | cause, |
| 3802 | }), |
| 3803 | }); |
| 3804 | } |
| 3805 | } |
| 3806 | }); |
| 3807 | |
| 3808 | const base = { |
| 3809 | integrations: { |
nothing calls this directly
no test coverage detected