mirror of
https://github.com/appium/appium.git
synced 2026-02-05 00:58:56 -06:00
no need to reset timeout if prelaunched
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user