()
| 4165 | // ------------------------------------------------------------------ |
| 4166 | |
| 4167 | const close = () => |
| 4168 | Effect.gen(function* () { |
| 4169 | for (const runtime of runtimes.values()) { |
| 4170 | if (runtime.plugin.close) { |
| 4171 | yield* runtime.plugin |
| 4172 | .close() |
| 4173 | .pipe( |
| 4174 | Effect.mapError((cause) => pluginStorageFailure(runtime.plugin.id, "close", cause)), |
| 4175 | ); |
| 4176 | } |
| 4177 | } |
| 4178 | if (closeDb) { |
| 4179 | const out = closeDb(); |
| 4180 | if (Effect.isEffect(out)) { |
| 4181 | yield* out; |
| 4182 | } else if (out instanceof Promise) { |
| 4183 | yield* Effect.tryPromise({ |
| 4184 | try: () => out, |
| 4185 | catch: (cause) => |
| 4186 | new StorageError({ |
| 4187 | message: "Executor database close failed", |
| 4188 | cause, |
| 4189 | }), |
| 4190 | }); |
| 4191 | } |
| 4192 | } |
| 4193 | }); |
| 4194 | |
| 4195 | const base = { |
| 4196 | integrations: { |
no test coverage detected