mirror of https://github.com/M66B/FairEmail.git
Take idle time into account for account errors
This commit is contained in:
parent
c74d83006a
commit
1b643d13ec
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue