This commit is contained in:
Ciro Spaciari
2025-09-08 19:25:15 -07:00
parent 3be879682e
commit edec93a475

View File

@@ -396,13 +396,19 @@ class PooledMySQLConnection {
this.queryCount = 0;
this.flags &= ~PooledConnectionFlags.reserved;
// notify all queries that the connection is closed
for (const onClose of queries) {
onClose(err);
}
const onFinish = this.onFinish;
if (onFinish) {
onFinish(err);
try {
// notify all queries that the connection is closed
for (const onClose of queries) {
onClose(err);
}
const onFinish = this.onFinish;
if (onFinish) {
onFinish(err);
}
} catch (e) {
console.log("onClose error", e, this instanceof PooledMySQLConnection, this, this.queries);
console.log("error", err);
throw e;
}
this.adapter.release(this, true);