From b3cf7ccdb7ae9c9da6eca9118b209f2ec02a9996 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Wed, 1 Apr 2020 15:39:29 -0500 Subject: [PATCH] Remove batch update blocks that were causing more harm than good. --- Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift index a40eb3eb3..8dce7e1ed 100644 --- a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift +++ b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift @@ -59,7 +59,6 @@ final class CloudKitAccountDelegate: AccountDelegate { func receiveRemoteNotification(for account: Account, userInfo: [AnyHashable : Any], completion: @escaping () -> Void) { let group = DispatchGroup() - BatchUpdate.shared.start() zones.forEach { zone in group.enter() @@ -69,7 +68,6 @@ final class CloudKitAccountDelegate: AccountDelegate { } group.notify(queue: DispatchQueue.main) { - BatchUpdate.shared.end() completion() } } @@ -77,9 +75,10 @@ final class CloudKitAccountDelegate: AccountDelegate { func refreshAll(for account: Account, completion: @escaping (Result) -> Void) { BatchUpdate.shared.start() accountZone.fetchChangesInZone() { result in + BatchUpdate.shared.end() switch result { case .success: - + self.sendArticleStatus(for: account) { result in switch result { case .success: @@ -89,7 +88,6 @@ final class CloudKitAccountDelegate: AccountDelegate { case .success: self.refresher.refreshFeeds(account.flattenedWebFeeds()) { - BatchUpdate.shared.end() account.metadata.lastArticleFetchEndTime = Date() completion(.success(())) }