if there is a question here, the answer is to do what it says "Retry after X seconds". The actual time is included in the info dictionary of the error. Here's a snippet from CloudCore, an open-source sync engine, that shows how it retrieves this info…
private func handle(error: Error, …) {
guard let cloudError = error as? CKError else {
…
return
}
switch cloudError.code {
case .requestRateLimited, .zoneBusy, .serviceUnavailable:
if let number = cloudError.userInfo[CKErrorRetryAfterKey] as? NSNumber {
let pauseUntil = Date(timeIntervalSinceNow: number.doubleValue)
}
…
}
}
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: