mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
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:
@@ -323,7 +323,7 @@ export class PostgresV1 implements INodeType {
|
||||
|
||||
const db = pgp(config);
|
||||
await db.connect();
|
||||
pgp.end();
|
||||
await db.$pool.end();
|
||||
} catch (error) {
|
||||
return {
|
||||
status: 'Error',
|
||||
@@ -412,15 +412,15 @@ export class PostgresV1 implements INodeType {
|
||||
|
||||
returnItems = wrapData(updateItems);
|
||||
} 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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user