mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 04:02:54 -06:00
chore: Set the maximum number of listeners that can be registered for events
This commit is contained in:
parent
7ca9bff6e0
commit
1ded6c81ad
@ -16,6 +16,9 @@ LOG_COLOR=true
|
|||||||
# Log Baileys - "fatal" | "error" | "warn" | "info" | "debug" | "trace"
|
# Log Baileys - "fatal" | "error" | "warn" | "info" | "debug" | "trace"
|
||||||
LOG_BAILEYS=error
|
LOG_BAILEYS=error
|
||||||
|
|
||||||
|
# Set the maximum number of listeners that can be registered for an event
|
||||||
|
EVENT_EMITTER_MAX_LISTENERS=50
|
||||||
|
|
||||||
# Determine how long the instance should be deleted from memory in case of no connection.
|
# Determine how long the instance should be deleted from memory in case of no connection.
|
||||||
# Default time: 5 minutes
|
# Default time: 5 minutes
|
||||||
# If you don't even want an expiration, enter the value false
|
# If you don't even want an expiration, enter the value false
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
* Sync lost messages on chatwoot
|
* Sync lost messages on chatwoot
|
||||||
|
* Set the maximum number of listeners that can be registered for events
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import EventEmitter2 from 'eventemitter2';
|
import EventEmitter2 from 'eventemitter2';
|
||||||
|
|
||||||
|
const maxListeners = parseInt(process.env.EVENT_EMITTER_MAX_LISTENERS, 10) || 50;
|
||||||
|
|
||||||
export const eventEmitter = new EventEmitter2({
|
export const eventEmitter = new EventEmitter2({
|
||||||
delimiter: '.',
|
delimiter: '.',
|
||||||
newListener: false,
|
newListener: false,
|
||||||
ignoreErrors: false,
|
ignoreErrors: false,
|
||||||
maxListeners: 50,
|
maxListeners: maxListeners,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user