Notify on background thread to prevent main thread deadlock

This commit is contained in:
Maurice Parker 2020-05-02 14:44:40 -05:00
parent 7e86f3dec3
commit 9d7d09a2a2
1 changed files with 4 additions and 2 deletions

View File

@ -64,9 +64,11 @@ class CloudKitSendStatusOperation: MainThreadOperation {
}
}
group.notify(queue: DispatchQueue.main) {
group.notify(queue: DispatchQueue.global(qos: .background)) {
os_log(.debug, log: self.log, "Done sending article statuses.")
self.operationDelegate?.operationDidComplete(self)
DispatchQueue.main.async {
self.operationDelegate?.operationDidComplete(self)
}
}
}