mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Reset failed foreground sync
This commit is contained in:
parent
e71f6d5db1
commit
f80d6c683b
2 changed files with 12 additions and 3 deletions
|
@ -222,7 +222,7 @@ class Core {
|
|||
if (ex instanceof MessageRemovedException ||
|
||||
ex instanceof FolderNotFoundException ||
|
||||
ex instanceof IllegalArgumentException) {
|
||||
Log.w("Unrecoverable", ex);
|
||||
Log.w("Unrecoverable");
|
||||
|
||||
// There is no use in repeating
|
||||
db.operation().deleteOperation(op.id);
|
||||
|
@ -254,12 +254,18 @@ class Core {
|
|||
} else if (ex instanceof MessagingException) {
|
||||
// Socket timeout is a recoverable condition (send message)
|
||||
if (ex.getCause() instanceof SocketTimeoutException) {
|
||||
Log.w("Recoverable", ex);
|
||||
Log.w("Recoverable");
|
||||
// No need to inform user
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (EntityOperation.SYNC.equals(op.name) && jargs.getBoolean(3) /* foreground */) {
|
||||
Log.w("Deleting foreground SYNC");
|
||||
db.operation().deleteOperation(op.id);
|
||||
db.folder().setFolderSyncState(folder.id, null);
|
||||
}
|
||||
|
||||
throw ex;
|
||||
}
|
||||
} finally {
|
||||
|
|
|
@ -228,11 +228,14 @@ public class EntityOperation {
|
|||
if (folder.account != null)
|
||||
account = db.account().getAccount(folder.account);
|
||||
|
||||
JSONArray jargs = folder.getSyncArgs();
|
||||
jargs.put(foreground);
|
||||
|
||||
EntityOperation operation = new EntityOperation();
|
||||
operation.folder = folder.id;
|
||||
operation.message = null;
|
||||
operation.name = SYNC;
|
||||
operation.args = folder.getSyncArgs().toString();
|
||||
operation.args = jargs.toString();
|
||||
operation.created = new Date().getTime();
|
||||
operation.id = db.operation().insertOperation(operation);
|
||||
|
||||
|
|
Loading…
Reference in a new issue