violetics 7.0.13-alpha → 7.0.14-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,6 +6,11 @@ export class WebSocketClient extends AbstractSocketClient {
|
|
|
6
6
|
super(...arguments);
|
|
7
7
|
this.socket = null;
|
|
8
8
|
this.socketListeners = new Map();
|
|
9
|
+
this.reconnectAttempts = 0;
|
|
10
|
+
this.maxReconnectAttempts = this.config.maxReconnectAttempts || 5;
|
|
11
|
+
this.reconnectDelay = this.config.reconnectDelay || 1000;
|
|
12
|
+
this.maxReconnectDelay = this.config.maxReconnectDelay || 30000;
|
|
13
|
+
this.reconnecting = false;
|
|
9
14
|
}
|
|
10
15
|
get isOpen() {
|
|
11
16
|
return this.socket?.readyState === WebSocket.OPEN;
|
|
@@ -33,6 +33,7 @@ export const makeEventBuffer = (logger, config = {}) => {
|
|
|
33
33
|
let activeBufferedTimeouts = new Set();
|
|
34
34
|
const MAX_HISTORY_CACHE_SIZE = config.maxHistoryCacheSize || 10000;
|
|
35
35
|
const BUFFER_TIMEOUT_MS = config.bufferTimeoutMs || 30000;
|
|
36
|
+
const MAX_BUFFER_COUNT = config.maxBufferCount || 10000;
|
|
36
37
|
// take the generic event and fire it as a baileys event
|
|
37
38
|
ev.on('event', (map) => {
|
|
38
39
|
for (const event in map) {
|