From 275ebf751d16625fd36441287f022479384a9cb3 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 27 Jan 2020 13:28:55 +0100 Subject: [PATCH] Batch operation by priority for offline folders --- .../main/java/eu/faircode/email/TupleOperationEx.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/TupleOperationEx.java b/app/src/main/java/eu/faircode/email/TupleOperationEx.java index bf68a63233..868781a77c 100644 --- a/app/src/main/java/eu/faircode/email/TupleOperationEx.java +++ b/app/src/main/java/eu/faircode/email/TupleOperationEx.java @@ -48,6 +48,12 @@ public class TupleOperationEx extends EntityOperation { PartitionKey getPartitionKey(boolean offline) { PartitionKey key = new PartitionKey(); + if (offline) { + // open/close folder is expensive + key.priority = this.priority + 10; + return key; + } + if (FETCH.equals(name)) try { JSONArray jargs = new JSONArray(args); @@ -62,9 +68,6 @@ public class TupleOperationEx extends EntityOperation { key.priority = this.priority; key.operation = this.name; - if (offline) - key.priority += 10; - return key; }