Don't try to sync article statuses if a sync is already in progress.

This commit is contained in:
Maurice Parker 2020-04-26 06:23:40 -05:00
parent e4f0a87a64
commit 4e2e4ef348

View File

@ -97,6 +97,11 @@ final class CloudKitAccountDelegate: AccountDelegate {
}
func sendArticleStatus(for account: Account, completion: @escaping ((Result<Void, Error>) -> Void)) {
guard refreshProgress.isComplete else {
completion(.success(()))
return
}
os_log(.debug, log: log, "Sending article statuses...")
database.selectForProcessing { result in
@ -149,6 +154,11 @@ final class CloudKitAccountDelegate: AccountDelegate {
func refreshArticleStatus(for account: Account, completion: @escaping ((Result<Void, Error>) -> Void)) {
guard refreshProgress.isComplete else {
completion(.success(()))
return
}
os_log(.debug, log: log, "Refreshing article statuses...")
articlesZone.refreshArticles() { result in