Skip to content

Commit

Permalink
fix: increase max listeners of Worker (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored Jul 12, 2023
1 parent df35155 commit f47f20b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/master/implementation.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ function initWorkerThreadsWorker(): ImplementationExport {
super(resolvedScriptPath, options)
}

// Worker event emitter can have more than 10 listeners during normal operation
// Increase max listeners to prevent MaxListenersExceededWarning
// See https://github.com/ChainSafe/lodestar/issues/5552
this.setMaxListeners(100)

this.mappedEventListeners = new WeakMap()
allWorkers.push(this)
}
Expand Down

0 comments on commit f47f20b

Please sign in to comment.