fix(db): log the demo baseline refusal through the logger, read the tool versions at once

This commit is contained in:
Maurice
2026-11-17 14:23:12 +01:00
parent fa193a400e
commit 4e07de492b
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -197,8 +197,9 @@ export async function refuseClientOlderThanServer(
binDir: string | undefined,
serverMajor: number,
): Promise<void> {
for (const tool of tools) {
const major = await pgToolMajor(tool, binDir);
const majors = await Promise.all(tools.map((tool) => pgToolMajor(tool, binDir)));
for (const [i, tool] of tools.entries()) {
const major = majors[i];
if (major !== null && major >= serverMajor) continue;
throw new Error(
`${tool} is version ${major ?? 'unknown'}, older than the PostgreSQL ${serverMajor} server, which it cannot ` +