Skip to content

Commit

Permalink
Enable unlimited queuing without a warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Jul 22, 2018
1 parent fafea13 commit 16ebbb7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/request.js
Expand Up @@ -66,7 +66,12 @@ function buildRequest (opts) {
if (!http2Client || http2Client.destroyed) {
http2Client = http2.connect(baseUrl, { rejectUnauthorized })
http2Client.once('error', done)
// we might enqueue a large number of requests in this connection
// before it's connected
http2Client.setMaxListeners(0)
http2Client.on('connect', () => {
// reset the max listener to 10 on connect
http2Client.setMaxListeners(10)
http2Client.removeListener('error', done)
})
}
Expand Down

0 comments on commit 16ebbb7

Please sign in to comment.