Added option to set poll interval per folder

This commit is contained in:
M66B
2018-10-01 09:14:21 +00:00
parent 703d8af6e8
commit 11e9333f14
9 changed files with 1063 additions and 11 deletions

View File

@@ -814,9 +814,8 @@ public class ServiceSynchronize extends LifecycleService {
Log.i(Helper.TAG, folder.name + " start noop");
while (state.running && ifolder.isOpen()) {
try {
Thread.sleep(account.poll_interval * 60 * 1000L);
if (!EntityFolder.USER.equals(folder.type) && capIdle) {
Thread.sleep(account.poll_interval * 60 * 1000L);
Log.i(Helper.TAG, folder.name + " request NOOP");
ifolder.doCommand(new IMAPFolder.ProtocolCommand() {
public Object doCommand(IMAPProtocol p) throws ProtocolException {
@@ -826,8 +825,13 @@ public class ServiceSynchronize extends LifecycleService {
return null;
}
});
} else
} else {
if (folder.poll_interval == null)
Thread.sleep(account.poll_interval * 60 * 1000L);
else
Thread.sleep(folder.poll_interval * 60 * 1000L);
synchronizeMessages(account, folder, ifolder, state);
}
} catch (InterruptedException ex) {
Log.w(Helper.TAG, folder.name + " noop " + ex.toString());