Skip to content

Commit

Permalink
fix: increase listeners on any-signal (#1084)
Browse files Browse the repository at this point in the history
Increase the number of listeners we allow on the actual signal we pass along, instead of the signal we pass into any-signal.
  • Loading branch information
achingbrain committed Dec 29, 2021
1 parent b4b4324 commit f18fc80
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dialer/index.js
Expand Up @@ -252,14 +252,15 @@ class Dialer {

// Combine the timeout signal and options.signal, if provided
const timeoutController = new TimeoutController(this.timeout)
// this controller will potentially be used while dialing lots of
// peers so prevent MaxListenersExceededWarning appearing in the console
setMaxListeners && setMaxListeners(Infinity, timeoutController.signal)

const signals = [timeoutController.signal]
options.signal && signals.push(options.signal)
const signal = anySignal(signals)

// this signal will potentially be used while dialing lots of
// peers so prevent MaxListenersExceededWarning appearing in the console
setMaxListeners && setMaxListeners(Infinity, signal)

const pendingDial = {
dialRequest,
controller: timeoutController,
Expand Down

0 comments on commit f18fc80

Please sign in to comment.