From ec12232fb84b73d28dcb8e5dfd661cb7a8cf7dc1 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 15 May 2024 09:33:14 -0700 Subject: [PATCH] =?UTF-8?q?Move=20MainThreadOperation=20and=20MainThreadOp?= =?UTF-8?q?erationQueue=20to=20CloudKitSync,=20which=20is=20the=20last=20p?= =?UTF-8?q?lace=20where=20it=E2=80=99s=20used.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift | 6 ++---- .../Sources/CloudKitSync}/MainThreadOperation.swift | 0 .../Sources/CloudKitSync}/MainThreadOperationQueue.swift | 0 3 files changed, 2 insertions(+), 4 deletions(-) rename {Core/Sources/Core => CloudKitSync/Sources/CloudKitSync}/MainThreadOperation.swift (100%) rename {Core/Sources/Core => CloudKitSync/Sources/CloudKitSync}/MainThreadOperationQueue.swift (100%) diff --git a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift index e03e37b94..fe1456179 100644 --- a/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift @@ -71,9 +71,6 @@ final class FeedlyAccountDelegate: AccountDelegate { private let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Feedly") private let syncDatabase: SyncDatabase - private weak var currentSyncAllOperation: MainThreadOperation? - private let operationQueue = MainThreadOperationQueue() - init(dataFolder: String, transport: Transport?, api: FeedlyAPICaller.API, secretsProvider: SecretsProvider) { // Many operations have their own operation queues, such as the sync all operation. // Making this a serial queue at this higher level of abstraction means we can ensure, @@ -933,7 +930,8 @@ final class FeedlyAccountDelegate: AccountDelegate { func suspendNetwork() { MainActor.assumeIsolated { caller.suspend() - operationQueue.cancelAllOperations() + // TODO: cancel tasks + // operationQueue.cancelAllOperations() } } diff --git a/Core/Sources/Core/MainThreadOperation.swift b/CloudKitSync/Sources/CloudKitSync/MainThreadOperation.swift similarity index 100% rename from Core/Sources/Core/MainThreadOperation.swift rename to CloudKitSync/Sources/CloudKitSync/MainThreadOperation.swift diff --git a/Core/Sources/Core/MainThreadOperationQueue.swift b/CloudKitSync/Sources/CloudKitSync/MainThreadOperationQueue.swift similarity index 100% rename from Core/Sources/Core/MainThreadOperationQueue.swift rename to CloudKitSync/Sources/CloudKitSync/MainThreadOperationQueue.swift