Move MainThreadOperation and MainThreadOperationQueue to CloudKitSync, which is the last place where it’s used.

This commit is contained in:
Brent Simmons 2024-05-15 09:33:14 -07:00
parent 01f08b9f27
commit ec12232fb8
3 changed files with 2 additions and 4 deletions

View File

@ -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()
}
}