mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-25 15:32:52 +00:00
Consider mac connections as I/O error
This commit is contained in:
parent
d88b7036e1
commit
762e4ee6ec
2 changed files with 2 additions and 18 deletions
|
@ -3401,7 +3401,6 @@ class Core {
|
||||||
private Semaphore semaphore = new Semaphore(0);
|
private Semaphore semaphore = new Semaphore(0);
|
||||||
private boolean running = true;
|
private boolean running = true;
|
||||||
private boolean recoverable = true;
|
private boolean recoverable = true;
|
||||||
private boolean maxConnections = false;
|
|
||||||
private Long lastActivity = null;
|
private Long lastActivity = null;
|
||||||
|
|
||||||
private Map<FolderPriority, Long> sequence = new HashMap<>();
|
private Map<FolderPriority, Long> sequence = new HashMap<>();
|
||||||
|
@ -3471,17 +3470,8 @@ class Core {
|
||||||
yield();
|
yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMaxConnections() {
|
|
||||||
maxConnections = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean getMaxConnections() {
|
|
||||||
return maxConnections;
|
|
||||||
}
|
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
recoverable = true;
|
recoverable = true;
|
||||||
maxConnections = false;
|
|
||||||
lastActivity = null;
|
lastActivity = null;
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
for (FolderPriority key : sequence.keySet()) {
|
for (FolderPriority key : sequence.keySet()) {
|
||||||
|
|
|
@ -873,10 +873,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||||
|
|
||||||
EntityLog.log(ServiceSynchronize.this, account.name + " alert: " + message);
|
EntityLog.log(ServiceSynchronize.this, account.name + " alert: " + message);
|
||||||
|
|
||||||
boolean max = isMaxConnections(message);
|
if (!isMaxConnections(message))
|
||||||
if (max)
|
|
||||||
state.setMaxConnections();
|
|
||||||
if (!max || state.getBackoff() > CONNECT_BACKOFF_MAX)
|
|
||||||
try {
|
try {
|
||||||
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
nm.notify("alert:" + account.id, 1,
|
nm.notify("alert:" + account.id, 1,
|
||||||
|
@ -906,10 +903,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||||
boolean ioError = false;
|
boolean ioError = false;
|
||||||
Throwable c = ex;
|
Throwable c = ex;
|
||||||
while (c != null) {
|
while (c != null) {
|
||||||
boolean max = isMaxConnections(c.getMessage());
|
if (isMaxConnections(c.getMessage()) ||
|
||||||
if (max)
|
|
||||||
state.setMaxConnections();
|
|
||||||
if (max ||
|
|
||||||
c instanceof IOException ||
|
c instanceof IOException ||
|
||||||
c instanceof ConnectionException ||
|
c instanceof ConnectionException ||
|
||||||
c instanceof AccountsException ||
|
c instanceof AccountsException ||
|
||||||
|
|
Loading…
Reference in a new issue