fix(core): Pg-promise de-initialization fix (#7417)

Github issue / Community forum post (link here to close automatically):

https://community.n8n.io/t/postgres-node-called-end-on-pool-more-than-once/30585/1
This commit is contained in:
Michael Kret
2023-10-12 12:10:14 +03:00
committed by GitHub
parent 2b6a15e478
commit 77039044eb
7 changed files with 20 additions and 20 deletions

View File

@@ -224,7 +224,7 @@ export class PostgresTrigger implements INodeType {
const additionalFields = this.getNodeParameter('additionalFields', 0) as IDataObject;
// initialize and connect to database
const { db, pgp } = await initDB.call(this);
const { db } = await initDB.call(this);
const connection = await db.connect({ direct: true });
// prepare and set up listener
@@ -284,7 +284,7 @@ export class PostgresTrigger implements INodeType {
`Postgres Trigger Error: ${(error as Error).message}`,
);
} finally {
pgp.end();
await db.$pool.end();
}
};