fix: close finite remote database connections

This commit is contained in:
vorotamoroz committed 2026-08-14 10:29:29 +00:00
1 parent 16c7cc1b0f
commit de03534d2f
10 files changed
+163 -45

No files matched your search

@@ -8,7 +8,7 @@ export type CouchDBConnectionProbeResult = { ok: true } | { ok: false; reason: s
type CouchDBConnectionResult =
| string
| {
db: unknown;
db: { close(): Promise<void> };
info: unknown;
};
@@ -50,7 +50,11 @@ export async function probeCouchDBConnection(
if (typeof result === "string") {
return { ok: false, reason: result };
}
return { ok: true };
try {
return { ok: true };
} finally {
await result.db.close();
}
}
export function isValidCouchDBServerURL(value: string): boolean {