Skip to content

Commit e7f00bc

Browse files
authored
fix(Postgres Chat Memory Node): Do not terminate the connection pool (#12674)
1 parent e6a15df commit e7f00bc

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

Diff for: packages/@n8n/nodes-langchain/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.ts

-5
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,7 @@ export class MemoryPostgresChat implements INodeType {
115115
...kOptions,
116116
});
117117

118-
async function closeFunction() {
119-
void pool.end();
120-
}
121-
122118
return {
123-
closeFunction,
124119
response: logWrapper(memory, this),
125120
};
126121
}

Diff for: packages/nodes-base/nodes/Postgres/transport/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export async function configurePostgres(
186186
nodeVersion: options.nodeVersion as unknown as string,
187187
fallBackHandler,
188188
cleanUpHandler: async ({ db }) => {
189-
await db.$pool.end();
189+
if (!db.$pool.ended) await db.$pool.end();
190190
},
191191
});
192192
}

0 commit comments

Comments
 (0)