mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 19:35:10 +01:00
Poll when needed only
This commit is contained in:
@@ -1328,11 +1328,16 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
|
||||
if (scheduled || jcondition.optBoolean("ignore_schedule")) {
|
||||
work = true;
|
||||
|
||||
List<EntityFolder> folders = db.folder().getSynchronizingFolders(account.id);
|
||||
if (folders.size() > 0)
|
||||
Collections.sort(folders, folders.get(0).getComparator(ServiceSynchronize.this));
|
||||
for (EntityFolder folder : folders)
|
||||
EntityOperation.poll(ServiceSynchronize.this, folder.id);
|
||||
if (folder.poll ||
|
||||
!account.poll_exempted ||
|
||||
account.protocol == EntityAccount.TYPE_POP ||
|
||||
!BuildConfig.DEBUG)
|
||||
EntityOperation.poll(ServiceSynchronize.this, folder.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user