Bring back stop delay

pull/160/head
M66B 5 years ago
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…
Cancel
Save