Merge branch 'mac-release'
This commit is contained in:
commit
2ec55e6587
|
@ -52,10 +52,14 @@ class FetchRequestOperation {
|
||||||
var fetchersReturned = 0
|
var fetchersReturned = 0
|
||||||
var fetchedArticles = Set<Article>()
|
var fetchedArticles = Set<Article>()
|
||||||
for articleFetcher in articleFetchers {
|
for articleFetcher in articleFetchers {
|
||||||
|
var didCallCompletion = false
|
||||||
articleFetcher.fetchArticlesAsync { (articles) in
|
articleFetcher.fetchArticlesAsync { (articles) in
|
||||||
precondition(Thread.isMainThread)
|
precondition(Thread.isMainThread)
|
||||||
if self.isCanceled {
|
if self.isCanceled {
|
||||||
completion(self)
|
if !didCallCompletion {
|
||||||
|
didCallCompletion = true
|
||||||
|
completion(self)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fetchedArticles.formUnion(articles)
|
fetchedArticles.formUnion(articles)
|
||||||
|
|
Loading…
Reference in New Issue