Solvedbull Possible memory leak if too many process

node: v6.9.5
bull: ^3.0.0-alpha.1

for (const name of lodash.range(11)) {
  bull.process(name.toString(), function ({ data }) {
    console.log('here')
  })
}

It will throw this error
(node:83132) Warning: Possible EventEmitter memory leak detected. 11 resumed listeners added. Use emitter.setMaxListeners() to increase limit

22 Answers

✔️Accepted Answer

It's a property, not a method.

const EventEmitter = require( "events" );  
EventEmitter.defaultMaxListeners = 20;

More Issues: