Use Task.sleep instead of a weird thing.
This commit is contained in:
parent
f8f67b1912
commit
5a02ba417f
|
@ -114,11 +114,7 @@ public protocol CloudKitZone: AnyObject {
|
||||||
|
|
||||||
func delay(for seconds: Double) async {
|
func delay(for seconds: Double) async {
|
||||||
|
|
||||||
await withCheckedContinuation { continuation in
|
try? await Task.sleep(for: .seconds(1))
|
||||||
self.retryIfPossible(after: seconds) {
|
|
||||||
continuation.resume()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nonisolated func retryIfPossible(after: Double, block: @escaping @Sendable @MainActor () -> ()) {
|
nonisolated func retryIfPossible(after: Double, block: @escaping @Sendable @MainActor () -> ()) {
|
||||||
|
|
Loading…
Reference in New Issue