mirror of https://github.com/M66B/FairEmail.git
Explicitly cancel operations on failure
This commit is contained in:
parent
3cece148c0
commit
b68cb942d2
|
@ -149,8 +149,8 @@ class Core {
|
|||
boolean group = true;
|
||||
Log.i(folder.name + " executing operations=" + ops.size());
|
||||
while (retry < LOCAL_RETRY_MAX && ops.size() > 0 &&
|
||||
state.batchCanRun(folder.id, priority, sequence) &&
|
||||
state.isRunning() && ifolder.isOpen()) {
|
||||
state.isRunning() &&
|
||||
state.batchCanRun(folder.id, priority, sequence)) {
|
||||
TupleOperationEx op = ops.get(0);
|
||||
|
||||
try {
|
||||
|
@ -3471,6 +3471,10 @@ class Core {
|
|||
void reset() {
|
||||
recoverable = true;
|
||||
lastActivity = null;
|
||||
resetBatches();
|
||||
}
|
||||
|
||||
void resetBatches() {
|
||||
synchronized (this) {
|
||||
for (FolderPriority key : sequence.keySet()) {
|
||||
batch.put(key, sequence.get(key));
|
||||
|
|
|
@ -1486,6 +1486,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
}
|
||||
});
|
||||
|
||||
// Cancel running operations
|
||||
state.resetBatches();
|
||||
|
||||
// Close folders
|
||||
for (EntityFolder folder : mapFolders.keySet())
|
||||
if (folder.synchronize && !folder.poll && mapFolders.get(folder) != null) {
|
||||
|
|
Loading…
Reference in New Issue