From d7c5264ad0d74b043fd81e1120401b3b9bf91c66 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 16 May 2016 19:58:24 +0200 Subject: [PATCH] cap exponential backoff at 300s (10 attempts) --- src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index cc3647e6e..66fd65272 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; }