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

Also it is not necessary since the error catched in the promise .catch(..).
This commit is contained in:
Louis Lam 2022-07-18 23:14:16 +08:00
parent 2073f0c284
commit 65d71e5db0

View File

@ -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);