diff --git a/src/js/internal/sql/mysql.ts b/src/js/internal/sql/mysql.ts index 7d9612faef..a0f0cdad17 100644 --- a/src/js/internal/sql/mysql.ts +++ b/src/js/internal/sql/mysql.ts @@ -381,39 +381,6 @@ class PooledMySQLConnection { } #onClose(err) { - // let wrappedErr = err; - // this.state = PooledConnectionState.closed; - // this.connection = null; - // this.adapter.readyConnections.delete(this); - // const queries = new Set(this.queries); - // this.queries.clear(); - // this.queryCount = 0; - // this.flags &= ~PooledConnectionFlags.reserved; - // const onFinish = this.onFinish; - // const connectionInfo = this.connectionInfo; - // const adapter = this.adapter; - - // if (err) { - // wrappedErr = wrapError(err); - // } - - // this.storedError = wrappedErr; - - // // notify all queries that the connection is closed - // for (const onClose of queries) { - // onClose(wrappedErr); - // } - - // if (onFinish) { - // onFinish(wrappedErr); - // } - - // if (connectionInfo?.onclose) { - // connectionInfo.onclose(wrappedErr); - // } - - // adapter.release(this, true); - if (err) { err = wrapError(err); } diff --git a/src/sql/mysql/MySQLConnection.zig b/src/sql/mysql/MySQLConnection.zig index 69a3f0e836..120d17aa13 100644 --- a/src/sql/mysql/MySQLConnection.zig +++ b/src/sql/mysql/MySQLConnection.zig @@ -401,15 +401,7 @@ pub fn failWithJSValue(this: *MySQLConnection, value: JSValue) void { const queries_array = this.getQueriesArray(); queries_array.ensureStillAlive(); - // this.globalObject.queueMicrotask(on_close, &[_]JSValue{ js_error, queries_array }); - _ = on_close.call( - this.globalObject, - .js_undefined, - &[_]JSValue{ - js_error, - queries_array, - }, - ) catch |e| this.globalObject.reportActiveExceptionAsUnhandled(e); + this.globalObject.queueMicrotask(on_close, &[_]JSValue{ js_error, queries_array }); } pub fn fail(this: *MySQLConnection, message: []const u8, err: AnyMySQLError.Error) void {