mirror of https://github.com/M66B/FairEmail.git
Fixed mail event thread exhaustion
This commit is contained in:
parent
773726594e
commit
d1e802299d
|
@ -128,9 +128,6 @@ public class EmailService implements AutoCloseable {
|
|||
final static int DEFAULT_CONNECT_TIMEOUT = 20; // seconds
|
||||
final static boolean SEPARATE_STORE_CONNECTION = false;
|
||||
|
||||
private static final ExecutorService executor =
|
||||
Helper.getBackgroundExecutor(0, 4, 3, "mail");
|
||||
|
||||
private final static int SEARCH_TIMEOUT = 90 * 1000; // milliseconds
|
||||
private final static int FETCH_SIZE = 1024 * 1024; // bytes, default 16K
|
||||
private final static int POOL_SIZE = 1; // connections
|
||||
|
@ -207,8 +204,8 @@ public class EmailService implements AutoCloseable {
|
|||
" apop=" + auth_apop +
|
||||
" use_top=" + use_top);
|
||||
|
||||
properties.put("mail.event.scope", "folder");
|
||||
properties.put("mail.event.executor", executor);
|
||||
//properties.put("mail.event.scope", "folder");
|
||||
//properties.put("mail.event.executor", executor);
|
||||
|
||||
if (!auth_plain)
|
||||
properties.put("mail." + protocol + ".auth.plain.disable", "true");
|
||||
|
|
|
@ -89,6 +89,7 @@ class EventQueue implements Runnable {
|
|||
executor.execute(this);
|
||||
} else {
|
||||
Thread qThread = new Thread(this, "Jakarta-Mail-EventQueue");
|
||||
qThread.setPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
|
||||
qThread.setDaemon(true); // not a user thread
|
||||
qThread.start();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue