mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 03:46:00 +01:00
Unified executor model
This commit is contained in:
@@ -44,7 +44,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
public class ViewModelMessages extends ViewModel {
|
||||
private AdapterMessage.ViewType last = AdapterMessage.ViewType.UNIFIED;
|
||||
@@ -68,9 +67,6 @@ public class ViewModelMessages extends ViewModel {
|
||||
}
|
||||
};
|
||||
|
||||
// AndroidX IO = 4 threads
|
||||
private ExecutorService executor = Helper.getBackgroundExecutor(4, "model");
|
||||
|
||||
private static final int LOCAL_PAGE_SIZE = 50;
|
||||
private static final int THREAD_PAGE_SIZE = 100;
|
||||
private static final int REMOTE_PAGE_SIZE = 10;
|
||||
@@ -204,7 +200,7 @@ public class ViewModelMessages extends ViewModel {
|
||||
break;
|
||||
}
|
||||
|
||||
builder.setFetchExecutor(executor);
|
||||
builder.setFetchExecutor(Helper.getParallelExecutor());
|
||||
|
||||
model = new Model(args, builder.build(), boundary);
|
||||
models.put(viewType, model);
|
||||
|
||||
Reference in New Issue
Block a user