Skip to content

Commit

Permalink
Checking if a block has been cancelled immediately before it runs (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
plivesey authored Sep 14, 2016
1 parent 0a6f93f commit af57cf3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ConsistencyManager/ConsistencyManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,10 @@ public class ConsistencyManager {
// Default to true if weakOperation is nil
return weakOperation?.cancelled ?? true
}
// Let's check here to see if it's cancelled before we start
if cancelled() {
return
}
task(cancelled)
}
weakOperation = operation
Expand Down

0 comments on commit af57cf3

Please sign in to comment.