broken-link-checker
broken-link-checker copied to clipboard
Possible EventEmitter memory leak detected on Redirects
When testing the links of some websites like the nytimes.com you will notice a warning message :
(node:4687) Warning: Possible EventEmitter memory leak detected. 11 pipe listeners added. Use emitter.setMaxListeners() to increase limit
This is due, I think, to some links have a great deal of redirect. What do you think of having a MaxRedirect option ? (like the request module for instance).
My set up:
const check = new LinkChecker.HtmlChecker({excludeExternalLinks: true, filterLevel: 0}, {
link: (result) => {
links.goodLinks++;
if (result.broken)
links.brokenLinks++;
},
complete: () => {
return wrapper(links.goodLinks, links.brokenLinks);
}
});
check.scan(this.resource.html(), this.url, links);
This library uses bhttp, which has a default max of 10 redirects. Not sure what's causing this issue.
If you get a chance, please try out the v0.8 pre-release (on master branch).