Prioritize inbox operations

pull/210/head
M66B 2 years ago
parent 9aba647ffc
commit 4219eda056

@ -2114,7 +2114,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
List<TupleOperationEx.PartitionKey> keys = new ArrayList<>(); List<TupleOperationEx.PartitionKey> keys = new ArrayList<>();
synchronized (partitions) { synchronized (partitions) {
for (TupleOperationEx op : added.get(folder.id)) { for (TupleOperationEx op : added.get(folder.id)) {
TupleOperationEx.PartitionKey key = op.getPartitionKey(offline); TupleOperationEx.PartitionKey key = op.getPartitionKey(offline, folder.type);
if (!partitions.containsKey(key)) { if (!partitions.containsKey(key)) {
partitions.put(key, new ArrayList<>()); partitions.put(key, new ArrayList<>());

@ -45,7 +45,7 @@ public class TupleOperationEx extends EntityOperation {
return false; return false;
} }
PartitionKey getPartitionKey(boolean offline) { PartitionKey getPartitionKey(boolean offline, String folderType) {
PartitionKey key = new PartitionKey(); PartitionKey key = new PartitionKey();
key.folder = this.folder; key.folder = this.folder;
@ -53,11 +53,13 @@ public class TupleOperationEx extends EntityOperation {
if (offline) { if (offline) {
// open/close folder is expensive // open/close folder is expensive
key.priority = this.priority + 10; key.priority = this.priority + 20;
return key; return key;
} }
key.priority = this.priority; key.priority = this.priority;
if (!EntityFolder.INBOX.equals(folderType))
key.priority += 10;
if (ADD.equals(name) || if (ADD.equals(name) ||
DELETE.equals(name)) DELETE.equals(name))

Loading…
Cancel
Save