public long getLastUpdate() { return Math.max(getLastChecked(), getLastPush()); }
final MessagingListener listener) { Timber.v("Folder %s was last synced @ %tc", folder.getServerId(), folder.getLastChecked()); if (!ignoreLastCheckedTime && folder.getLastChecked() > System.currentTimeMillis() - accountInterval) { Timber.v("Not syncing folder %s, previously synced @ %tc which would be too recent for the account " + "period", folder.getServerId(), folder.getLastChecked()); return;
@Override public void run() { LocalFolder tLocalFolder = null; try { // In case multiple Commands get enqueued, don't run more than // once final LocalStore localStore = localStoreProvider.getInstance(account); tLocalFolder = localStore.getFolder(folder.getServerId()); tLocalFolder.open(Folder.OPEN_MODE_RW); if (!ignoreLastCheckedTime && tLocalFolder.getLastChecked() > (System.currentTimeMillis() - accountInterval)) { Timber.v("Not running Command for folder %s, previously synced @ %tc which would " + "be too recent for the account period", folder.getServerId(), folder.getLastChecked()); return; } showFetchingMailNotificationIfNecessary(account, folder); try { synchronizeMailboxSynchronous(account, folder.getServerId(), listener, null); } finally { clearFetchingMailNotificationIfNecessary(account); } } catch (Exception e) { Timber.e(e, "Exception while processing folder %s:%s", account.getDescription(), folder.getServerId()); } finally { closeFolder(tLocalFolder); } } }