fix(livesync): dispose when stopping livesync#3376
Closed
Mitko-Kerezov wants to merge 1 commit into
Closed
Conversation
Contributor
Author
|
run ci |
rosen-vladimirov
suggested changes
Feb 20, 2018
| public dispose(): void { | ||
| if (this.brokerProcess && this.shouldDisposeInstance) { | ||
| public dispose(disposeOptions?: IForceOption): void { | ||
| if ((disposeOptions && disposeOptions.force) || (this.brokerProcess && this.shouldDisposeInstance)) { |
Contributor
There was a problem hiding this comment.
In case you do not have a brokerProcess, but disposeOptions.force is true, you'll have an error on the next line.
c6f2970 to
5a9a4cf
Compare
Contributor
|
run ci |
rosen-vladimirov
suggested changes
Feb 25, 2018
| // as in case we execute nativescript-dev-typescript's before-prepare hook again in the same process, it MUST transpile the files. | ||
| this.$usbLiveSyncService.isInitialized = false; | ||
| // After stopping LiveSync we need to dispose of everything in order for the process to end and release all resources | ||
| this.$injector.dispose({ force: true }); |
Contributor
There was a problem hiding this comment.
this will cause issues with device detection in Sidekick where we have a long living process. We shouldn't dispose the injector in this case, as this will kill iOS devices detection as well. We should find a better general solution for this case.
Contributor
Author
|
Closing this in regards to the issues @rosen-vladimirov pointed out, will rethink the approach an open a new PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Whenever LiveSync fails to launch for the first time CLI doesn't break process execution because there are hanging child processes (ios-device detection, analytics).
If this is the case, force dispose those resources.
Fixes: #3375
Ping @rosen-vladimirov