mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 14:41:08 +00:00
Refactoring
This commit is contained in:
parent
4ea1b549f0
commit
503c1f521e
1 changed files with 5 additions and 3 deletions
|
@ -470,13 +470,13 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
|
|||
(ex instanceof AuthenticationFailedException && !ConnectionHelper.isIoError(ex)) ||
|
||||
ex instanceof SendFailedException ||
|
||||
ex instanceof IllegalArgumentException);
|
||||
int tries_left = (unrecoverable ? 0 : RETRY_MAX - op.tries);
|
||||
|
||||
db.operation().setOperationError(op.id, Log.formatThrowable(ex));
|
||||
if (message != null) {
|
||||
db.message().setMessageError(message.id, Log.formatThrowable(ex));
|
||||
|
||||
try {
|
||||
int tries_left = (unrecoverable ? 0 : RETRY_MAX - op.tries);
|
||||
NotificationManager nm = Helper.getSystemService(this, NotificationManager.class);
|
||||
if (NotificationHelper.areNotificationsEnabled(nm)) {
|
||||
NotificationCompat.Builder builder = getNotificationError(
|
||||
|
@ -524,11 +524,13 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
|
|||
}
|
||||
}
|
||||
|
||||
if (op.tries >= RETRY_MAX || unrecoverable) {
|
||||
Log.w("Unrecoverable");
|
||||
if (tries_left <= 0) {
|
||||
Log.w("Send tries left=" + tries_left +
|
||||
" unrecoverable=" + unrecoverable);
|
||||
db.operation().deleteOperation(op.id);
|
||||
ops.remove(op);
|
||||
} else {
|
||||
Log.i("Send retry wait");
|
||||
Thread.sleep(RETRY_WAIT);
|
||||
throw ex;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue