mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 05:44:51 +02:00
Yield after wakeup
This commit is contained in:
@@ -98,6 +98,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
private MutableLiveData<List<TupleAccountState>> liveAccountState = new MutableLiveData<>();
|
||||
private MediatorState liveAccountNetworkState = new MediatorState();
|
||||
|
||||
private static final long YIELD_DURATION = 200L; // milliseconds
|
||||
private static final int CONNECT_BACKOFF_START = 8; // seconds
|
||||
private static final int CONNECT_BACKOFF_MAX = 64; // seconds (totally 2 minutes)
|
||||
private static final int CONNECT_BACKOFF_AlARM = 15; // minutes
|
||||
@@ -604,6 +605,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
else {
|
||||
EntityLog.log(this, "### waking up account=" + account);
|
||||
state.release();
|
||||
try {
|
||||
Thread.sleep(YIELD_DURATION);
|
||||
} catch (InterruptedException ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user