You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting the following when I fire off emails inside a loop with 11+ iterations (i.e., 10 or fewer iterations doesn't generate this warning):
c$ node mailer-test.js
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace:
at SMTPClient.<anonymous> (events.js:133:17)
at SMTPClientPool.send (/Users/c/dev/mailer-test/node_modules/mailer/lib/node_mailer.js:72:10)
at dispatchMail (/Users/c/dev/mailer-test/node_modules/mailer/lib/node_mailer.js:112:12)
at Object.node_mail [as send] (/Users/c/dev/mailer-test/node_modules/mailer/lib/node_mailer.js:159:5)
at Object.<anonymous> (/Users/c/dev/mailer-test/mailer-test.js:5:10)
at Module._compile (module.js:425:26)
at Object..js (module.js:443:10)
at Module.load (module.js:344:31)
at Function._load (module.js:303:12)
at Array.0 (module.js:463:10)
To be clear, everything works (emails are sent)--just reporting the memory leak warning. Maybe a false positive?
Tested with mailer 0.6.7 and node 0.5.7 (darwin) / 0.6.3 (win32) using the following:
varmailer=require('mailer');for(vari=0;i<11;i++){// Change 11 to 10 and warnings no longer appearmailer.send({to: 'Some Body <someone@somewhere.com>',from : 'Me <me@somewhereelse.com>',subject: 'Test '+i,body: 'Blah',host : "xxx",port : "465",ssl: true,authentication : "login",username : "xxx",password : "yyy"},function(err,result){if(err){console.log(err);}});}
The text was updated successfully, but these errors were encountered:
I got the problem in my unit tests. The warning s fired only for more than 10 new instance of the "transporter" but there is no warning to send more than 10 email with the same transporter. You just need to make sure nodemailer.createTransport() is called once.
The problem is real if you need to send mails with 11 different configurations
Getting the following when I fire off emails inside a loop with 11+ iterations (i.e., 10 or fewer iterations doesn't generate this warning):
To be clear, everything works (emails are sent)--just reporting the memory leak warning. Maybe a false positive?
Tested with mailer 0.6.7 and node 0.5.7 (darwin) / 0.6.3 (win32) using the following:
The text was updated successfully, but these errors were encountered: