|
|
@ -2239,10 +2239,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
throw new StoreClosedException(iservice.getStore(), "Unrecoverable", cause);
|
|
|
|
throw new StoreClosedException(iservice.getStore(), "Unrecoverable", cause);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Check token expiration
|
|
|
|
|
|
|
|
if (!account.isTransient(this))
|
|
|
|
|
|
|
|
iservice.check();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sends store NOOP
|
|
|
|
// Sends store NOOP
|
|
|
|
if (EmailService.SEPARATE_STORE_CONNECTION) {
|
|
|
|
if (EmailService.SEPARATE_STORE_CONNECTION) {
|
|
|
|
EntityLog.log(this, EntityLog.Type.Account, account,
|
|
|
|
EntityLog.log(this, EntityLog.Type.Account, account,
|
|
|
@ -2357,6 +2353,16 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
long duration = account.poll_interval * 60 * 1000L;
|
|
|
|
long duration = account.poll_interval * 60 * 1000L;
|
|
|
|
long trigger = System.currentTimeMillis() + duration;
|
|
|
|
long trigger = System.currentTimeMillis() + duration;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!account.isTransient(this)) {
|
|
|
|
|
|
|
|
Long expirationTime = iservice.getAccessTokenExpirationTime();
|
|
|
|
|
|
|
|
if (expirationTime != null && expirationTime < trigger) {
|
|
|
|
|
|
|
|
EntityLog.log(this, EntityLog.Type.Debug, "Expedite keep alive" +
|
|
|
|
|
|
|
|
" from " + new Date(trigger) + " to " + new Date(expirationTime));
|
|
|
|
|
|
|
|
trigger = expirationTime;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EntityLog.log(this, EntityLog.Type.Account, account,
|
|
|
|
EntityLog.log(this, EntityLog.Type.Account, account,
|
|
|
|
"### " + account.name + " keep alive" +
|
|
|
|
"### " + account.name + " keep alive" +
|
|
|
|
" wait=" + account.poll_interval + " until=" + new Date(trigger));
|
|
|
|
" wait=" + account.poll_interval + " until=" + new Date(trigger));
|
|
|
|