Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/258#discussion_r52795575
  
    --- Diff: bin/templates/cordova/lib/emulator.js ---
    @@ -227,18 +236,25 @@ module.exports.wait_for_emulator = function(uuid) {
     };
     
     /*
    - * Waits for the core android process of the emulator to start
    + * Waits for the core android process of the emulator to start. Returns a
    + * promise that resolves to a boolean indicating success. Not specifying a
    + * time_remaining or passing a negative value will cause it to wait forever
      */
    -module.exports.wait_for_boot = function(emulator_id) {
    +module.exports.wait_for_boot = function(emulator_id, time_remaining) {
         var self = this;
         return Adb.shell(emulator_id, 'ps')
         .then(function(output) {
             if (output.match(/android\.process\.acore/)) {
    -            return;
    +            return true;
    +        } else if (time_remaining === 0) {
    +            return false;
             } else {
                 process.stdout.write('.');
    -            return Q.delay(3000).then(function() {
    -                return self.wait_for_boot(emulator_id);
    +
    +            // Check at regular intervals
    +            return Q.delay(time_remaining < CHECK_BOOTED_INTERVAL ? 
time_remaining : CHECK_BOOTED_INTERVAL).then(function() {
    --- End diff --
    
    Maybe use `Math.min` here instead of the ternary operator? It's a little 
hard to read long ternary conditions.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to