Add timeouts everywhere. Should help if the ADB socket gets stuck like it sometimes does.

This commit is contained in:
Simo Kinnunen
2014-04-02 11:58:53 +09:00
parent 64d4782436
commit 0ce65687c5
10 changed files with 51 additions and 5 deletions

View File

@@ -30,8 +30,10 @@ module.exports = syrup.serial()
function getPath() {
return adb.shell(options.serial, ['pm', 'path', resource.pkg])
.timeout(10000)
.then(function(out) {
return streamutil.findLine(out, (/^package:/))
.timeout(15000)
.then(function(line) {
return line.substr(8)
})
@@ -49,6 +51,7 @@ module.exports = syrup.serial()
, installedPath
, resource.main
))
.timeout(10000)
.then(function(out) {
return streamutil.readAll(out)
.timeout(10000)
@@ -69,6 +72,7 @@ module.exports = syrup.serial()
.catch(function() {
log.info('Installing STFService')
return adb.install(options.serial, resource.apk)
.timeout(30000)
.then(function() {
return getPath()
})