Poll when needed only

pull/209/head
M66B 2 years ago
parent 5e3a9a5135
commit fd2ab14150

@ -1328,10 +1328,15 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
if (scheduled || jcondition.optBoolean("ignore_schedule")) { if (scheduled || jcondition.optBoolean("ignore_schedule")) {
work = true; work = true;
List<EntityFolder> folders = db.folder().getSynchronizingFolders(account.id); List<EntityFolder> folders = db.folder().getSynchronizingFolders(account.id);
if (folders.size() > 0) if (folders.size() > 0)
Collections.sort(folders, folders.get(0).getComparator(ServiceSynchronize.this)); Collections.sort(folders, folders.get(0).getComparator(ServiceSynchronize.this));
for (EntityFolder folder : folders) for (EntityFolder folder : folders)
if (folder.poll ||
!account.poll_exempted ||
account.protocol == EntityAccount.TYPE_POP ||
!BuildConfig.DEBUG)
EntityOperation.poll(ServiceSynchronize.this, folder.id); EntityOperation.poll(ServiceSynchronize.this, folder.id);
} }
} }

Loading…
Cancel
Save