Yield after wakeup

This commit is contained in:
M66B
2019-12-12 09:53:06 +01:00
parent fbc3bd1f12
commit 936bc45c44

View File

@@ -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);
}
}
}