Fixes an issue where sending article statuses to Feedly was finishing prematurely.

This commit is contained in:
Kiel Gillard 2019-11-06 11:22:10 +11:00
parent 560f36621f
commit 1a1ee0fa17
4 changed files with 5 additions and 4 deletions

View File

@ -20,12 +20,14 @@ class FeedlyOperation: Operation {
func didFinish() {
assert(Thread.isMainThread)
assert(!isFinished, "Finished operation is attempting to finish again.")
self.isExecutingOperation = false
self.isFinishedOperation = true
}
func didFinish(_ error: Error) {
assert(Thread.isMainThread)
assert(!isFinished, "Finished operation is attempting to finish again.")
delegate?.feedlyOperation(self, didFailWith: error)
didFinish()
}

View File

@ -24,9 +24,8 @@ final class FeedlySendArticleStatusesOperation: FeedlyOperation {
}
override func main() {
defer { didFinish() }
guard !isCancelled else {
didFinish()
return
}

View File

@ -27,9 +27,8 @@ final class FeedlySetStarredArticlesOperation: FeedlyOperation {
}
override func main() {
defer { didFinish() }
guard !isCancelled else {
didFinish()
return
}

View File

@ -102,6 +102,7 @@ final class FeedlySyncAllOperation: FeedlyOperation {
override func main() {
guard !isCancelled else {
// override of cancel calls didFinish().
return
}