diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index df1908c524..64ad451364 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -260,9 +260,6 @@ public class Helper { private static ExecutorService sMediaExecutor = null; private static ExecutorService sDownloadExecutor = null; - private static int sOperationIndex = 0; - private static final ExecutorService[] sOperationExecutor = new ExecutorService[OPERATION_WORKERS]; - static ExecutorService getSerialExecutor() { if (sSerialExecutor == null) sSerialExecutor = getBackgroundExecutor(1, "serial"); @@ -293,16 +290,6 @@ public class Helper { return sDownloadExecutor; } - static ExecutorService getOperationExecutor() { - synchronized (sOperationExecutor) { - if (sOperationExecutor[sOperationIndex] == null) - sOperationExecutor[sOperationIndex] = getBackgroundExecutor(1, "operation"); - ExecutorService result = sOperationExecutor[sOperationIndex]; - sOperationIndex = (sOperationIndex + 1) % sOperationExecutor.length; - return result; - } - } - static ExecutorService getBackgroundExecutor(int threads, final String name) { ThreadFactory factory = new ThreadFactory() { private final AtomicInteger threadId = new AtomicInteger(); diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 6df1a1774f..58f682e14d 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1550,7 +1550,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences Log.i(account.name + " run thread=" + currentThread); final ObjectHolder cowner = new ObjectHolder<>(); - final ExecutorService executor = Helper.getOperationExecutor(); + final ExecutorService executor = Helper.getBackgroundExecutor(1, "operation." + account.id); // Debug SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);