Bring back stop delay

pull/160/head
M66B 6 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 ACCOUNT_ERROR_AFTER = 60; // minutes
private static final int BACKOFF_ERROR_AFTER = 16; // seconds private static final int BACKOFF_ERROR_AFTER = 16; // seconds
private static final long ONESHOT_DURATION = 90 * 1000L; // milliseconds 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_ALARM = 1;
static final int PI_ONESHOT = 2; static final int PI_ONESHOT = 2;
@ -453,9 +454,15 @@ public class ServiceSynchronize extends ServiceBase {
EntityLog.log(ServiceSynchronize.this, "Reload done queued=" + queued); EntityLog.log(ServiceSynchronize.this, "Reload done queued=" + queued);
if (!doStart && queued == 0 && !isEnabled()) { if (!doStart && queued == 0 && !isEnabled()) {
try {
Thread.sleep(STOP_DELAY);
} catch (InterruptedException ignored) {
}
if (queued == 0 && !isEnabled()) {
stopped = true; stopped = true;
stopService(lastStartId); stopService(lastStartId);
} }
}
wl.release(); wl.release();
} }

Loading…
Cancel
Save