Skip to content

Commit

Permalink
fix(Postgres Chat Memory Node): Do not terminate the connection pool (n…
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy authored and SysAdmin Onestic committed Jan 17, 2025
1 parent fd87232 commit 76ac301
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,7 @@ export class MemoryPostgresChat implements INodeType {
...kOptions,
});

async function closeFunction() {
void pool.end();
}

return {
closeFunction,
response: logWrapper(memory, this),
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Postgres/transport/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export async function configurePostgres(
nodeVersion: options.nodeVersion as unknown as string,
fallBackHandler,
cleanUpHandler: async ({ db }) => {
await db.$pool.end();
if (!db.$pool.ended) await db.$pool.end();
},
});
}

0 comments on commit 76ac301

Please sign in to comment.