@applitools/execution-grid-tunnel
Advanced tools
Comparing version 2.0.1 to 2.1.0
{ | ||
"name": "@applitools/execution-grid-tunnel", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "scripts/run-execution-grid-tunnel.js", |
@@ -41,4 +41,12 @@ 'use strict' | ||
getResponse: getOriginalError, | ||
}), | ||
}) | ||
}) | ||
app.route({ | ||
method: 'GET', | ||
url: '/tunnels', | ||
handler: async function(_request, reply){ | ||
const tunnelIds = this.tunnelProcessManager.getRunningTunnels() | ||
return reply.status(200).send(tunnelIds) | ||
} | ||
}) | ||
} |
@@ -32,11 +32,9 @@ const path = require('path') | ||
this.getActiveTunnels = () => | ||
Array.from(this._tunnelsMap.keys()).filter((id) => { | ||
const {processController} = this._tunnelsMap.get(id) | ||
return ( | ||
processController && | ||
(processController.status === TUNNEL_STATUS.RUNNING || | ||
processController.status === TUNNEL_STATUS.RECONNECT) | ||
) // TODO: if user want to stop tunnel, should we stop to send heartbeat? | ||
}) | ||
this._getTunnelByStatus = (states) => Array.from(this._tunnelsMap.keys()).filter((id) => { | ||
const {processController} = this._tunnelsMap.get(id) | ||
return processController && states.includes(processController.status) | ||
}) | ||
this.getActiveTunnels = () => this._getTunnelByStatus([TUNNEL_STATUS.RUNNING, TUNNEL_STATUS.RECONNECT]) | ||
this.getRunningTunnels = () => this._getTunnelByStatus([TUNNEL_STATUS.RUNNING]) | ||
} | ||
@@ -43,0 +41,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47063
1309