aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-16 19:58:24 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-05-16 19:58:24 +0200
commitd7c5264ad0d74b043fd81e1120401b3b9bf91c66 (patch)
tree246edc62934de98c93f33f7c750d74173558bc46 /src/main
parent331cbf3696e1900dfc2e77d8b94e9590378bd050 (diff)
cap exponential backoff at 300s (10 attempts)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index cc3647e6..66fd6527 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -1422,7 +1422,7 @@ public class XmppConnection implements Runnable {
}
public int getTimeToNextAttempt() {
- final int interval = (int) (25 * Math.pow(1.5, attempt));
+ final int interval = Math.min((int) (25 * Math.pow(1.3, attempt)), 300);
final int secondsSinceLast = (int) ((SystemClock.elapsedRealtime() - this.lastConnect) / 1000);
return interval - secondsSinceLast;
}