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

@@ -256,15 +256,15 @@ export class QuestDb implements INodeType {
returnItems = this.helpers.returnJsonArray(insertData);
} else {
pgp.end();
await db.$pool.end();
throw new NodeOperationError(
this.getNode(),
`The operation "${operation}" is not supported!`,
);
}
// Close the connection
pgp.end();
// shuts down the connection pool associated with the db object to allow the process to finish
await db.$pool.end();
return [returnItems];
}