mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Reset forwards on ungroup.
This commit is contained in:
parent
04d261044c
commit
44987cbc8b
1 changed files with 14 additions and 1 deletions
|
@ -15,7 +15,8 @@ module.exports = syrup.serial()
|
||||||
.dependency(require('../support/router'))
|
.dependency(require('../support/router'))
|
||||||
.dependency(require('../support/push'))
|
.dependency(require('../support/push'))
|
||||||
.dependency(require('../resources/minirev'))
|
.dependency(require('../resources/minirev'))
|
||||||
.define(function(options, adb, router, push, minirev) {
|
.dependency(require('./group'))
|
||||||
|
.define(function(options, adb, router, push, minirev, group) {
|
||||||
var log = logger.createLogger('device:plugins:forward')
|
var log = logger.createLogger('device:plugins:forward')
|
||||||
var plugin = Object.create(null)
|
var plugin = Object.create(null)
|
||||||
|
|
||||||
|
@ -99,6 +100,12 @@ module.exports = syrup.serial()
|
||||||
forwards[port].end()
|
forwards[port].end()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.removeAll = function() {
|
||||||
|
Object.keys(forwards).forEach(function(port) {
|
||||||
|
forwards[port].end()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var manager = new ForwardManager()
|
var manager = new ForwardManager()
|
||||||
|
@ -187,6 +194,12 @@ module.exports = syrup.serial()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugin.reset = function() {
|
||||||
|
manager.removeAll()
|
||||||
|
}
|
||||||
|
|
||||||
|
group.on('leave', plugin.reset)
|
||||||
|
|
||||||
return startService()
|
return startService()
|
||||||
.then(awaitServer)
|
.then(awaitServer)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue