fix(Postgres Node): Close connection pool only if it's not already closed or closing (#8690)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-02-21 11:27:21 +01:00
committed by GitHub
parent 890c2bd52b
commit 457cac4cf9
5 changed files with 7 additions and 7 deletions

View File

@@ -58,7 +58,7 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
sshClient.end();
}
await db.$pool.end();
if (!db.$pool.ending) await db.$pool.end();
}
return [returnData];

View File

@@ -23,7 +23,7 @@ export async function schemaSearch(this: ILoadOptionsFunctions): Promise<INodeLi
if (sshClient) {
sshClient.end();
}
await db.$pool.end();
if (!db.$pool.ending) await db.$pool.end();
}
}
export async function tableSearch(this: ILoadOptionsFunctions): Promise<INodeListSearchResult> {
@@ -54,6 +54,6 @@ export async function tableSearch(this: ILoadOptionsFunctions): Promise<INodeLis
if (sshClient) {
sshClient.end();
}
await db.$pool.end();
if (!db.$pool.ending) await db.$pool.end();
}
}

View File

@@ -31,7 +31,7 @@ export async function getColumns(this: ILoadOptionsFunctions): Promise<INodeProp
if (sshClient) {
sshClient.end();
}
await db.$pool.end();
if (!db.$pool.ending) await db.$pool.end();
}
}

View File

@@ -94,6 +94,6 @@ export async function getMappingColumns(
if (sshClient) {
sshClient.end();
}
await db.$pool.end();
if (!db.$pool.ending) await db.$pool.end();
}
}