mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 11:55:20 +01:00
Unified executor model
This commit is contained in:
@@ -58,7 +58,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.mail.Address;
|
||||
import javax.mail.AuthenticationFailedException;
|
||||
@@ -84,8 +83,6 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
|
||||
private PowerManager.WakeLock wlOutbox;
|
||||
private List<Long> handling = new ArrayList<>();
|
||||
|
||||
private static final ExecutorService executor = Helper.getBackgroundExecutor(1, "send");
|
||||
|
||||
private static final int RETRY_MAX = 3;
|
||||
private static final int CONNECTIVITY_DELAY = 5000; // milliseconds
|
||||
private static final int PROGRESS_UPDATE_INTERVAL = 1000; // milliseconds
|
||||
@@ -149,7 +146,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
|
||||
"Send process=" + TextUtils.join(",", process) +
|
||||
" handling=" + TextUtils.join(",", handling));
|
||||
|
||||
executor.submit(new Runnable() {
|
||||
Helper.getSerialExecutor().submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
processOperations(process);
|
||||
@@ -900,7 +897,7 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
|
||||
}
|
||||
|
||||
static void boot(final Context context) {
|
||||
executor.submit(new Runnable() {
|
||||
Helper.getSerialExecutor().submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user