Take idle time into account for account errors

This commit is contained in:
M66B 2019-01-24 18:50:37 +00:00
parent c74d83006a
commit 1b643d13ec
1 changed files with 2 additions and 2 deletions

View File

@ -144,7 +144,7 @@ public class ServiceSynchronize extends LifecycleService {
private static final int SYNC_BATCH_SIZE = 20;
private static final int DOWNLOAD_BATCH_SIZE = 20;
private static final long RECONNECT_BACKOFF = 90 * 1000L; // milliseconds
private static final int ACCOUNT_ERROR_AFTER = 90; // minutes
private static final int ACCOUNT_ERROR_AFTER = 60; // minutes
private static final int IDENTITY_ERROR_AFTER = 30; // minutes
private static final long STOP_DELAY = 5000L; // milliseconds
private static final long YIELD_DURATION = 200L; // milliseconds
@ -917,7 +917,7 @@ public class ServiceSynchronize extends LifecycleService {
if (account.last_connected != null) {
EntityLog.log(this, account.name + " last connected: " + new Date(account.last_connected));
long now = new Date().getTime();
long delayed = now - account.last_connected;
long delayed = now - account.last_connected - account.poll_interval * 60 * 1000L;
if (delayed > ACCOUNT_ERROR_AFTER * 60 * 1000L) {
Log.i("Reporting sync error after=" + delayed);
Throwable warning = new Throwable(