Fix mssqlQuery keep adding error listener, which causes memory leak.

Also it is not necessary since the error catched in the promise .catch(..).
pull/1853/head
Louis Lam 2 years ago
parent 2073f0c284
commit 65d71e5db0

@ -238,10 +238,6 @@ exports.dnsResolve = function (hostname, resolverServer, resolverPort, rrtype) {
*/
exports.mssqlQuery = function (connectionString, query) {
return new Promise((resolve, reject) => {
mssql.on("error", err => {
reject(err);
});
mssql.connect(connectionString).then(pool => {
return pool.request()
.query(query);

Loading…
Cancel
Save