-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Description
Hi
When more than 11 subscriptions occur we get the the node warning "MaxListenersExceededWarning: Possible EventEmitter memory leak detected."
The subscription server looks like this:
const pubsub = new PostgresPubSub({
host: 'localhost',
port: process.env.DB_PORT ? parseInt(process.env.DB_PORT) : 5432,
user: 'testuser',
password: 'testpassword',
database: 'whatsapp',
});[Solution] So i found out that you can change the max listeners in the event emitter of the pubsub instance, like so:
const pubsub = new PostgresPubSub({
host: 'localhost',
port: process.env.DB_PORT ? parseInt(process.env.DB_PORT) : 5432,
user: 'testuser',
password: 'testpassword',
database: 'whatsapp',
});
pubsub.ee.setMaxListeners(0); // raise max listeners in event emitter, 0 mean that is limitedThanks for sharing.
Best regards,
idkjsreymon359
Metadata
Metadata
Assignees
Labels
No labels