Skip to content

Commit

Permalink
Fix max listeners exceeded warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rlidwka committed Mar 10, 2021
1 parent bcdd824 commit a6da059
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ var pipeline = require('stream').pipeline;
module.exports = function probeStream(src, keepOpen) {
var proxy = new PassThrough();

// increase max number of listeners to stop memory leak warning
proxy.setMaxListeners(Object.keys(parsers).length + 10);

var result = new Promise(function (resolve, reject) {
src.on('error', reject);
proxy.on('error', reject);
Expand Down

0 comments on commit a6da059

Please sign in to comment.