From 2d033862c0fa45b8194213754f35b32aa9b3732b Mon Sep 17 00:00:00 2001 From: Jonathan Lipps Date: Fri, 29 Mar 2013 12:21:52 -0700 Subject: [PATCH] no need to reset timeout if prelaunched --- app/appium.js | 10 +++------- app/controller.js | 5 +---- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/app/appium.js b/app/appium.js index 64ff53882..1f4ea1617 100644 --- a/app/appium.js +++ b/app/appium.js @@ -75,16 +75,12 @@ Appium.prototype.preLaunch = function(cb) { } else { var me = this; var caps = {}; - this.start(caps, function(err, device) { + this.start(caps, function(err) { if (err) { cb(err, null); } else { - // since we're prelaunching, it might be a while before the first - // command comes in, so let's not have instruments quit on us - device.setCommandTimeout(600, function() { - me.preLaunched = true; - cb(null, me); - }); + me.preLaunched = true; + cb(null, me); } }); } diff --git a/app/controller.js b/app/controller.js index e5882efbd..ac1f363dd 100644 --- a/app/controller.js +++ b/app/controller.js @@ -137,16 +137,13 @@ exports.createSession = function(req, res) { var desired = req.body.desiredCapabilities; - var next = function(reqHost, sessionId, device, preLaunched) { + var next = function(reqHost, sessionId, device) { var redirect = function() { res.set('Location', "http://"+reqHost+"/wd/hub/session/" + sessionId); res.send(303); }; if (desired && desired.newCommandTimeout) { device.setCommandTimeout(desired.newCommandTimeout, redirect); - } else if (preLaunched) { - // reset timeout to something more reasonable - device.resetCommandTimeout(redirect); } else { redirect(); }