Added option to turn off logarithmic back-off

This commit is contained in:
M66B
2022-03-09 10:11:04 +01:00
parent dd0c68b918
commit 148092cdf6
4 changed files with 46 additions and 3 deletions

View File

@@ -2365,8 +2365,14 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
int backoff = state.getBackoff();
int recently = (lastLost + LOST_RECENTLY < now ? 1 : 2);
boolean logarithmic_backoff = prefs.getBoolean("logarithmic_backoff", true);
EntityLog.log(this, EntityLog.Type.Account, account,
account.name + " backoff=" + backoff + " recently=" + recently + "x");
account.name + " backoff=" + backoff +
" recently=" + recently + "x" +
" logarithmic=" + logarithmic_backoff);
if (!logarithmic_backoff)
backoff = CONNECT_BACKOFF_START;
if (backoff < CONNECT_BACKOFF_MAX)
state.setBackoff(backoff * 2);