mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Postgres Node): Re-use connection pool across executions (#12346)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -320,7 +320,6 @@ export class PostgresV1 implements INodeType {
|
||||
|
||||
const db = pgp(config);
|
||||
await db.connect();
|
||||
await db.$pool.end();
|
||||
} catch (error) {
|
||||
return {
|
||||
status: 'Error',
|
||||
@@ -409,16 +408,12 @@ export class PostgresV1 implements INodeType {
|
||||
|
||||
returnItems = wrapData(updateItems);
|
||||
} else {
|
||||
await db.$pool.end();
|
||||
throw new NodeOperationError(
|
||||
this.getNode(),
|
||||
`The operation "${operation}" is not supported!`,
|
||||
);
|
||||
}
|
||||
|
||||
// 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