From f97194b9be29b21b5ea6d26eb586db6020aad49e Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 2 Apr 2020 14:13:57 -0500 Subject: [PATCH] Removed long running operations support as I don't think we need it. --- .../CloudKit/CloudKitAccountDelegate.swift | 1 - Frameworks/Account/CloudKit/CloudKitZone.swift | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift index 02636e56d..6b3e45e2d 100644 --- a/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift +++ b/Frameworks/Account/CloudKit/CloudKitAccountDelegate.swift @@ -423,7 +423,6 @@ final class CloudKitAccountDelegate: AccountDelegate { } zones.forEach { zone in - zone.resumeLongLivedOperationIfPossible() zone.subscribe() } } diff --git a/Frameworks/Account/CloudKit/CloudKitZone.swift b/Frameworks/Account/CloudKit/CloudKitZone.swift index 15b91baf4..02fe62f17 100644 --- a/Frameworks/Account/CloudKit/CloudKitZone.swift +++ b/Frameworks/Account/CloudKit/CloudKitZone.swift @@ -46,20 +46,6 @@ extension CloudKitZone { return CKRecord.ID(recordName: UUID().uuidString, zoneID: Self.zoneID) } - func resumeLongLivedOperationIfPossible() { - guard let container = container else { return } - container.fetchAllLongLivedOperationIDs { (opIDs, error) in - guard let opIDs = opIDs else { return } - for opID in opIDs { - container.fetchLongLivedOperation(withID: opID, completionHandler: { (ope, error) in - if let modifyOp = ope as? CKModifyRecordsOperation { - container.add(modifyOp) - } - }) - } - } - } - func subscribe() { let subscription = CKRecordZoneSubscription(zoneID: Self.zoneID) @@ -173,10 +159,6 @@ extension CloudKitZone { func modify(recordsToSave: [CKRecord], recordIDsToDelete: [CKRecord.ID], completion: @escaping (Result) -> Void) { let op = CKModifyRecordsOperation(recordsToSave: recordsToSave, recordIDsToDelete: recordIDsToDelete) - let config = CKOperation.Configuration() - config.isLongLived = true - op.configuration = config - // We use .changedKeys savePolicy to do unlocked changes here cause my app is contentious and off-line first // Apple suggests using .ifServerRecordUnchanged save policy // For more, see Advanced CloudKit(https://developer.apple.com/videos/play/wwdc2014/231/)