Commit 70743bd2 authored by Girish Ramakrishnan's avatar Girish Ramakrishnan

database: Fix event emitter warning

the connection object gets reused after release. this means that we keep
attaching the 'error' event and not unlistening.

--trace-warnings can be added to box.service to get the stack trace
parent 493f1505
......@@ -145,7 +145,9 @@ function rollback(connection, transactionError, callback) {
connection.rollback(function (error) {
if (error) debug('rollback: error when rolling back', error);
connection.removeAllListeners('error');
connection.release();
callback(transactionError);
});
}
......@@ -169,7 +171,9 @@ function transaction(queries, callback) {
connection.commit(function (error) {
if (error) return rollback(connection, error, callback);
connection.removeAllListeners('error');
connection.release();
callback(null, results);
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment