mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Postgres Node): Close connection pool only if it's not already closed or closing (#8690)
This commit is contained in:
committed by
GitHub
parent
890c2bd52b
commit
457cac4cf9
@@ -237,7 +237,7 @@ export class PostgresTrigger implements INodeType {
|
|||||||
this.emit([this.helpers.returnJsonArray([data])]);
|
this.emit([this.helpers.returnJsonArray([data])]);
|
||||||
};
|
};
|
||||||
|
|
||||||
// create trigger, funstion and channel or use existing channel
|
// create trigger, function and channel or use existing channel
|
||||||
const pgNames = prepareNames(this.getNode().id, this.getMode(), additionalFields);
|
const pgNames = prepareNames(this.getNode().id, this.getMode(), additionalFields);
|
||||||
if (triggerMode === 'createTrigger') {
|
if (triggerMode === 'createTrigger') {
|
||||||
await pgTriggerFunction.call(
|
await pgTriggerFunction.call(
|
||||||
@@ -284,7 +284,7 @@ export class PostgresTrigger implements INodeType {
|
|||||||
`Postgres Trigger Error: ${(error as Error).message}`,
|
`Postgres Trigger Error: ${(error as Error).message}`,
|
||||||
);
|
);
|
||||||
} finally {
|
} finally {
|
||||||
await db.$pool.end();
|
if (!db.$pool.ending) await db.$pool.end();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export async function router(this: IExecuteFunctions): Promise<INodeExecutionDat
|
|||||||
sshClient.end();
|
sshClient.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
await db.$pool.end();
|
if (!db.$pool.ending) await db.$pool.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
return [returnData];
|
return [returnData];
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export async function schemaSearch(this: ILoadOptionsFunctions): Promise<INodeLi
|
|||||||
if (sshClient) {
|
if (sshClient) {
|
||||||
sshClient.end();
|
sshClient.end();
|
||||||
}
|
}
|
||||||
await db.$pool.end();
|
if (!db.$pool.ending) await db.$pool.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export async function tableSearch(this: ILoadOptionsFunctions): Promise<INodeListSearchResult> {
|
export async function tableSearch(this: ILoadOptionsFunctions): Promise<INodeListSearchResult> {
|
||||||
@@ -54,6 +54,6 @@ export async function tableSearch(this: ILoadOptionsFunctions): Promise<INodeLis
|
|||||||
if (sshClient) {
|
if (sshClient) {
|
||||||
sshClient.end();
|
sshClient.end();
|
||||||
}
|
}
|
||||||
await db.$pool.end();
|
if (!db.$pool.ending) await db.$pool.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export async function getColumns(this: ILoadOptionsFunctions): Promise<INodeProp
|
|||||||
if (sshClient) {
|
if (sshClient) {
|
||||||
sshClient.end();
|
sshClient.end();
|
||||||
}
|
}
|
||||||
await db.$pool.end();
|
if (!db.$pool.ending) await db.$pool.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,6 @@ export async function getMappingColumns(
|
|||||||
if (sshClient) {
|
if (sshClient) {
|
||||||
sshClient.end();
|
sshClient.end();
|
||||||
}
|
}
|
||||||
await db.$pool.end();
|
if (!db.$pool.ending) await db.$pool.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user