()
| 7147 | // ------------------------------------------------------------------ |
| 7148 | |
| 7149 | const close = () => |
| 7150 | Effect.gen(function* () { |
| 7151 | for (const runtime of runtimes.values()) { |
| 7152 | if (runtime.plugin.close) { |
| 7153 | yield* runtime.plugin |
| 7154 | .close() |
| 7155 | .pipe( |
| 7156 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 7157 | ); |
| 7158 | } |
| 7159 | } |
| 7160 | if (closeDb) { |
| 7161 | const out = closeDb(); |
| 7162 | if (Effect.isEffect(out)) { |
| 7163 | yield* out; |
| 7164 | } else if (out instanceof Promise) { |
| 7165 | yield* Effect.tryPromise({ |
| 7166 | try: () => out, |
| 7167 | catch: (cause) => |
| 7168 | new StorageError({ |
| 7169 | message: "Executor database close failed", |
| 7170 | cause, |
| 7171 | }), |
| 7172 | }); |
| 7173 | } |
| 7174 | } |
| 7175 | }); |
| 7176 | |
| 7177 | const base = { |
| 7178 | integrations: { |
no test coverage detected