Open jeanmatthieud opened 2 years ago
I created a custom node script to start IPX, and increased the limit to "50". I'm still having the issue, with "51" close listeners.
Hi. Do you mind providing a reproduction? 🙏🏼
At first, I was using npx ipx
and saw the issue as reported in the issue.
Then, I created a little script, based on cli.ts
:
import consola from 'consola'
import { listen } from 'listhen'
import { createIPX, createIPXMiddleware } from 'ipx'
import { EventEmitter } from 'events';
// Added line
EventEmitter.defaultMaxListeners = 50;
async function main() {
const ipx = createIPX({})
const middleware = createIPXMiddleware(ipx)
await listen(middleware, {
clipboard: false
})
}
main().catch((err) => {
consola.error(err)
process.exit(1)
})
But I'm still getting the issue, with between 20 and 200 requests per minute. All images are stored online, and requested through HTTPS. They are already compressed (JPG 80%) and limited to 1920px per side (so they are not heavy images).
I'm using node 16 and npm 8.5.0.
Me too. And I set the evetemitter's maxListeners to zero. here the code: require('events').EventEmitter.defaultMaxListeners = 0
I running IPX with
npx ipx
and some env vars.I'm getting a lot of warnings in production:
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit