Sfoglia il codice sorgente

feat(xmpp): lower max XMPP retries to 3

Strophe's builtin retry mechanism uses exponential backoff, and 5 retries
results in a very long time.
dev1
Saúl Ibarra Corretgé 7 anni fa
parent
commit
d0a4f63948
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6
    1
      modules/xmpp/xmpp.js

+ 6
- 1
modules/xmpp/xmpp.js Vedi File

@@ -31,7 +31,12 @@ function createConnection(token, bosh = '/http-bind') {
31 31
         bosh += `${bosh.indexOf('?') === -1 ? '?' : '&'}token=${token}`;
32 32
     }
33 33
 
34
-    return new Strophe.Connection(bosh);
34
+    const conn = new Strophe.Connection(bosh);
35
+
36
+    // The default maxRetries is 5, which is too long.
37
+    conn.maxRetries = 3;
38
+
39
+    return conn;
35 40
 }
36 41
 
37 42
 /**

Loading…
Annulla
Salva