mirror of https://github.com/M66B/FairEmail.git
Bring back stop delay
This commit is contained in:
parent
9be0e5c788
commit
8a8ca574cd
|
@ -113,6 +113,7 @@ public class ServiceSynchronize extends ServiceBase {
|
|||
private static final int ACCOUNT_ERROR_AFTER = 60; // minutes
|
||||
private static final int BACKOFF_ERROR_AFTER = 16; // seconds
|
||||
private static final long ONESHOT_DURATION = 90 * 1000L; // milliseconds
|
||||
private static final long STOP_DELAY = 5000L; // milliseconds
|
||||
|
||||
static final int PI_ALARM = 1;
|
||||
static final int PI_ONESHOT = 2;
|
||||
|
@ -453,8 +454,14 @@ public class ServiceSynchronize extends ServiceBase {
|
|||
EntityLog.log(ServiceSynchronize.this, "Reload done queued=" + queued);
|
||||
|
||||
if (!doStart && queued == 0 && !isEnabled()) {
|
||||
stopped = true;
|
||||
stopService(lastStartId);
|
||||
try {
|
||||
Thread.sleep(STOP_DELAY);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
if (queued == 0 && !isEnabled()) {
|
||||
stopped = true;
|
||||
stopService(lastStartId);
|
||||
}
|
||||
}
|
||||
|
||||
wl.release();
|
||||
|
|
Loading…
Reference in New Issue