Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 1027232 - Restart b2g #2

Merged
merged 1 commit into from Jul 31, 2014
Merged

Bug 1027232 - Restart b2g #2

merged 1 commit into from Jul 31, 2014

Conversation

hfiguiere
Copy link
Contributor

No description provided.

@hfiguiere hfiguiere changed the title Restart b2g Bug 1027232 - Restart b2g Jul 9, 2014
sockit.connect({ host: '127.0.0.1', port: port });

var s = sockit.read(16).toString();
console.error('read', s);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is console.error() used here instead of console.debug() or console.log()? This doesn't look like an error case...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are actually left over debug I have removed here... BOTH.

// The marionette client should do that for you.
// https://bugzilla.mozilla.org/show_bug.cgi?id=1033402
// Callback still needs to be called Asynchronously
setTimeout(callback, 0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merely an FYI here: you could leave off the 0 here, or since it's Node, you can use the much more efficient process.nextTick(callback).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid Node specific stuff if I can :-)

I have seen setTimeout(callback, 0) elsewhere. MDN doesn't tell us that the delay is an optional parameter.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we just call the callback, we should be good since spawn is async.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope it doesn't work if I just call the callback. I actually tried that. I didn't dig the problem but the setTimeout did the trick.

@hfiguiere
Copy link
Contributor Author

@gaye I have updated the PR addressing comments.

@mikeizworkin
Copy link

@gaye this is a critical blocking issue. Please prioritize doing this review we need this asap.

@@ -62,7 +62,18 @@ Host.prototype = {
'tcp:' + DEFAULT_PORT]);
adb.on('close', function() {
debug('Set adb forward to ' + port);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug code. because it is useful when you need to diagnose. not sure what your question is.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I didn't see that this was called after the adb port forward command finished

hfiguiere added a commit that referenced this pull request Jul 31, 2014
Bug 1027232 - Restart b2g r=gaye
@hfiguiere hfiguiere merged commit 3c116cd into mozilla-b2g:master Jul 31, 2014
@hfiguiere hfiguiere deleted the bug1027232 branch July 31, 2014 15:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants