broken-link-checker icon indicating copy to clipboard operation
broken-link-checker copied to clipboard

Possible EventEmitter memory leak detected on Redirects

Open bluedge opened this issue 9 years ago • 2 comments

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

bluedge avatar Sep 27 '16 12:09 bluedge

This library uses bhttp, which has a default max of 10 redirects. Not sure what's causing this issue.

stevenvachon avatar Nov 12 '16 02:11 stevenvachon

If you get a chance, please try out the v0.8 pre-release (on master branch).

stevenvachon avatar Sep 26 '19 18:09 stevenvachon