mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 21:55:13 +00:00
Earlier quit cancel
This commit is contained in:
parent
ba8022f869
commit
fe2cc0a858
1 changed files with 11 additions and 9 deletions
|
@ -114,7 +114,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||||
|
|
||||||
private static final long BACKUP_DELAY = 30 * 1000L; // milliseconds
|
private static final long BACKUP_DELAY = 30 * 1000L; // milliseconds
|
||||||
private static final long PURGE_DELAY = 30 * 1000L; // milliseconds
|
private static final long PURGE_DELAY = 30 * 1000L; // milliseconds
|
||||||
private static final long QUIT_DELAY = 5 * 1000L; // milliseconds
|
private static final int QUIT_DELAY = 5; // seconds
|
||||||
private static final long STILL_THERE_THRESHOLD = 3 * 60 * 1000L; // milliseconds
|
private static final long STILL_THERE_THRESHOLD = 3 * 60 * 1000L; // milliseconds
|
||||||
static final int DEFAULT_POLL_INTERVAL = 0; // minutes
|
static final int DEFAULT_POLL_INTERVAL = 0; // minutes
|
||||||
private static final int OPTIMIZE_KEEP_ALIVE_INTERVAL = 12; // minutes
|
private static final int OPTIMIZE_KEEP_ALIVE_INTERVAL = 12; // minutes
|
||||||
|
@ -531,15 +531,17 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||||
MessageClassifier.save(ServiceSynchronize.this);
|
MessageClassifier.save(ServiceSynchronize.this);
|
||||||
} else {
|
} else {
|
||||||
// Yield update notifications/widgets
|
// Yield update notifications/widgets
|
||||||
try {
|
for (int i = 0; i < QUIT_DELAY; i++) {
|
||||||
Thread.sleep(QUIT_DELAY);
|
try {
|
||||||
} catch (InterruptedException ex) {
|
Thread.sleep(1000L);
|
||||||
Log.w(ex);
|
} catch (InterruptedException ex) {
|
||||||
}
|
Log.w(ex);
|
||||||
|
}
|
||||||
|
|
||||||
if (!eventId.equals(lastEventId)) {
|
if (!eventId.equals(lastEventId)) {
|
||||||
EntityLog.log(ServiceSynchronize.this, "### quit cancelled eventId=" + eventId + "/" + lastEventId);
|
EntityLog.log(ServiceSynchronize.this, "### quit cancelled eventId=" + eventId + "/" + lastEventId);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop service
|
// Stop service
|
||||||
|
|
Loading…
Reference in a new issue