mirror of https://github.com/M66B/FairEmail.git
Limit simple task thread to number of processors
This commit is contained in:
parent
4d9330e60b
commit
522f13a38c
|
@ -49,7 +49,8 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
|
||||||
private String name;
|
private String name;
|
||||||
private Result stored;
|
private Result stored;
|
||||||
|
|
||||||
private static ExecutorService executor = Executors.newCachedThreadPool(Helper.backgroundThreadFactory);
|
private static ExecutorService executor = Executors.newFixedThreadPool(
|
||||||
|
Runtime.getRuntime().availableProcessors(), Helper.backgroundThreadFactory);
|
||||||
|
|
||||||
public void execute(Context context, LifecycleOwner owner, Bundle args, String name) {
|
public void execute(Context context, LifecycleOwner owner, Bundle args, String name) {
|
||||||
run(context, owner, args, name);
|
run(context, owner, args, name);
|
||||||
|
|
Loading…
Reference in New Issue