-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Checking if a block has been cancelled immediately before it runs #35
Conversation
Previously was there because of testing
Sadly, I'm unable to work out how to write a unit test for this because |
@@ -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() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super-minor: instead of cancelled()
here, I'd put ()
at the end of the { }
block above, so you can just say if cancelled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't do that because I pass the cancelled block into the next function.
I actually need that closure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah my bad 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
lgtm after minor comment |
No description provided.