mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:03:30 +02:00
Reset forwards on ungroup.
This commit is contained in:
@@ -15,7 +15,8 @@ module.exports = syrup.serial()
|
||||
.dependency(require('../support/router'))
|
||||
.dependency(require('../support/push'))
|
||||
.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 plugin = Object.create(null)
|
||||
|
||||
@@ -99,6 +100,12 @@ module.exports = syrup.serial()
|
||||
forwards[port].end()
|
||||
}
|
||||
}
|
||||
|
||||
this.removeAll = function() {
|
||||
Object.keys(forwards).forEach(function(port) {
|
||||
forwards[port].end()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
var manager = new ForwardManager()
|
||||
@@ -187,6 +194,12 @@ module.exports = syrup.serial()
|
||||
})
|
||||
}
|
||||
|
||||
plugin.reset = function() {
|
||||
manager.removeAll()
|
||||
}
|
||||
|
||||
group.on('leave', plugin.reset)
|
||||
|
||||
return startService()
|
||||
.then(awaitServer)
|
||||
.then(function() {
|
||||
|
||||
Reference in New Issue
Block a user