cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alsoro...@apache.org
Subject [1/2] cordova-paramedic git commit: CB-12357 Only poll for events if previous poll is finished
Date Thu, 19 Jan 2017 22:08:59 GMT
Repository: cordova-paramedic
Updated Branches:
  refs/heads/master 1fe2c2d64 -> b27449fd9


CB-12357 Only poll for events if previous poll is finished


Project: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/commit/674440f2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/tree/674440f2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-paramedic/diff/674440f2

Branch: refs/heads/master
Commit: 674440f221982e3eb39422dec41e85dbe7a8f284
Parents: 1fe2c2d
Author: Alexander Sorokin <alexander.sorokin@akvelon.com>
Authored: Thu Jan 19 15:07:24 2017 +0300
Committer: Alexander Sorokin <alexander.sorokin@akvelon.com>
Committed: Thu Jan 19 15:07:24 2017 +0300

----------------------------------------------------------------------
 lib/paramedic.js | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/674440f2/lib/paramedic.js
----------------------------------------------------------------------
diff --git a/lib/paramedic.js b/lib/paramedic.js
index d440666..acf24e9 100644
--- a/lib/paramedic.js
+++ b/lib/paramedic.js
@@ -792,17 +792,23 @@ ParamedicRunner.prototype.runSauceTests = function () {
 
         var platform = self.config.getPlatformId();
         if (!self.config.getUseTunnel()) {
+            var polling = false;
             pollForResults = setInterval(function () {
-                driver.pollForEvents(platform)
-                .then(function (events) {
-                    for (var i = 0; i < events.length; i++) {
-                        self.server.emit(events[i].eventName, events[i].eventObject);
-                    }
-                })
-                .fail(function (error) {
-                    logger.warn('appium: ' + error);
-                });
-            }, 5000);
+                if (!polling) {
+                    polling = true;
+                    driver.pollForEvents(platform)
+                    .then(function (events) {
+                        for (var i = 0; i < events.length; i++) {
+                            self.server.emit(events[i].eventName, events[i].eventObject);
+                        }
+                        polling = false;
+                    })
+                    .fail(function (error) {
+                        logger.warn('appium: ' + error);
+                        polling = false;
+                    });
+                }
+            }, 2500);
         }
 
         return self.waitForTests();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message