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
POC [Fixes #311] fix cleanup #312
Conversation
stefanpenner
commented
Nov 21, 2016
- ensure cleanup gives the ability to wait until it is done
- improves support for mid-build cleanup, waits for the current task to complete, prevents the next task, and then exists.
* ensure cleanup gives the ability to wait until it is done * improves support for mid-build cleanup, waits for the current task to complete, prevents the next task, and then exists.
} | ||
|
||
// Destructor-like method. Cleanup is synchronous at the moment, but in the | ||
// future we might change it to return a promise. | ||
Builder.prototype.cleanup = function() { | ||
this._canceled = true | ||
this.builderTmpDirCleanup() |
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.
I don't think it's correct to try removing tmp dirs with builderTmpDirCleanup
while the build is still in progress. We'd need to wait for the current step to finish first.
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.
Oh. Wait, I think you're already saying this in your original comment (your list is a to-do list, yes?)...
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.
ya, the version in broccoli-builder 0.18.x waits
@@ -87,14 +91,17 @@ Builder.prototype.build = function() { | |||
|
|||
promise = promise | |||
.then(function() { | |||
if (self.cancelled) { return } |
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.
Tests will catch this anyway, but there's a tyop here (self._canceled
) :)
I actually wonder if it's conceptually necessary to tie the cancellation thing to the So if we do that, the Ctrl+C handler would do something like: cancelCurrentBuild()
then wait for currentBuild
then cleanup |
@joliss i'll update this to be more like what I ended-up with on 0.18.x. There are some nuanced differences, that have not made it to this PR yet. Some thoughts:
|
replaced by: #350 |