From b71f8a02468e906feb4729d068bec62b07278ddc Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 22 Jan 2021 17:26:32 +0100 Subject: [PATCH] Keep folder alive when skip polling --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 4e68d133b1..6d0c314de5 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1688,6 +1688,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences } else { if (folder.poll_count == 0) EntityOperation.sync(this, folder.id, false); + else { + if (!mapFolders.get(folder).isOpen()) + throw new StoreClosedException(iservice.getStore(), "NOOP " + folder.name); + } folder.poll_count = (folder.poll_count + 1) % folder.poll_factor; db.folder().setFolderPollCount(folder.id, folder.poll_count); Log.i(folder.name + " poll count=" + folder.poll_count);