fix(Postgres Node): Close connection pool only if it's not already closed or closing (#8690)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-02-21 11:27:21 +01:00
committed by GitHub
parent 890c2bd52b
commit 457cac4cf9
5 changed files with 7 additions and 7 deletions

View File

@@ -237,7 +237,7 @@ export class PostgresTrigger implements INodeType {
this.emit([this.helpers.returnJsonArray([data])]);
};
// create trigger, funstion and channel or use existing channel
// create trigger, function and channel or use existing channel
const pgNames = prepareNames(this.getNode().id, this.getMode(), additionalFields);
if (triggerMode === 'createTrigger') {
await pgTriggerFunction.call(
@@ -284,7 +284,7 @@ export class PostgresTrigger implements INodeType {
`Postgres Trigger Error: ${(error as Error).message}`,
);
} finally {
await db.$pool.end();
if (!db.$pool.ending) await db.$pool.end();
}
};