mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-25 23:35:21 +02:00
Give open device ports their own options. Preparing for future refactor.
This commit is contained in:
@@ -20,7 +20,7 @@ module.exports = syrup.serial()
|
||||
, plugin = Object.create(null)
|
||||
, activeServer = null
|
||||
|
||||
plugin.port = options.ports.pop()
|
||||
plugin.port = options.connectPort
|
||||
plugin.url = util.format('%s:%s', options.publicIp, plugin.port)
|
||||
|
||||
plugin.start = function() {
|
||||
|
||||
@@ -6,7 +6,7 @@ module.exports = syrup.serial()
|
||||
var plugin = Object.create(null)
|
||||
|
||||
plugin.devicePort = 9002
|
||||
plugin.publicPort = options.ports.pop()
|
||||
plugin.publicPort = options.screenPort
|
||||
plugin.publicUrl = _.template(options.screenWsUrlPattern)({
|
||||
publicIp: options.publicIp
|
||||
, publicPort: plugin.publicPort
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = function(options) {
|
||||
// port, we must ensure that we allocate ports in fixed groups.
|
||||
var ports = options.ports.slice(
|
||||
0
|
||||
, options.ports.length - options.ports.length % 4
|
||||
, options.ports.length - options.ports.length % 2
|
||||
)
|
||||
|
||||
// Information about total devices
|
||||
@@ -303,7 +303,7 @@ module.exports = function(options) {
|
||||
|
||||
// Spawn a device worker
|
||||
function spawn() {
|
||||
var allocatedPorts = ports.splice(0, 4)
|
||||
var allocatedPorts = ports.splice(0, 2)
|
||||
, proc = options.fork(device, allocatedPorts)
|
||||
, resolver = Promise.defer()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user