Logaritmic back-off on auth failures

pull/205/head
M66B 3 years ago
parent c244e4e0a6
commit bea7334df9

@ -1401,7 +1401,12 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
} else { } else {
Log.e(ex); Log.e(ex);
try { try {
state.setBackoff(2 * CONNECT_BACKOFF_ALARM_MAX * 60); int backoff = state.getBackoff();
if (backoff < 2 * CONNECT_BACKOFF_ALARM_MAX * 60)
backoff = 2 * CONNECT_BACKOFF_ALARM_MAX * 60;
else if (backoff < 8 * CONNECT_BACKOFF_ALARM_MAX * 60)
backoff *= 2;
state.setBackoff(backoff);
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify("receive:" + account.id, nm.notify("receive:" + account.id,
NotificationHelper.NOTIFICATION_TAGGED, NotificationHelper.NOTIFICATION_TAGGED,

Loading…
Cancel
Save