Przeglądaj źródła

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 lat temu
rodzic
commit
d0a4f63948
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6
    1
      modules/xmpp/xmpp.js

+ 6
- 1
modules/xmpp/xmpp.js Wyświetl plik

31
         bosh += `${bosh.indexOf('?') === -1 ? '?' : '&'}token=${token}`;
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
 /**

Ładowanie…
Anuluj
Zapisz