Small improvement

This commit is contained in:
M66B 2019-12-09 08:39:51 +01:00
parent 0c2c0d2f4c
commit a1eb5ed458
1 changed files with 4 additions and 2 deletions

View File

@ -1186,6 +1186,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
account.name + " " + Log.formatThrowable(ex, false));
db.account().setAccountError(account.id, Log.formatThrowable(ex));
} finally {
// Update state
EntityLog.log(this, account.name + " closing");
db.account().setAccountState(account.id, "closing");
// Stop watching for operations
handler.post(new Runnable() {
@Override
@ -1196,8 +1200,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
});
// Update state
EntityLog.log(this, account.name + " closing");
db.account().setAccountState(account.id, "closing");
for (EntityFolder folder : mapFolders.keySet())
if (folder.synchronize && !folder.poll && mapFolders.get(folder) != null)
db.folder().setFolderState(folder.id, "closing");