Skip to content

Commit

Permalink
eval: use ip variable when creating web-socket (#1650)
Browse files Browse the repository at this point in the history
Remove references to instance-uri for the backend that are
not used. Use the `ip` variable so it will work with IPv4
or IPv6.
  • Loading branch information
brharrington authored Apr 3, 2024
1 parent 875a7f6 commit aa364b7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions atlas-eval/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ atlas.eval {
backends = [
{
host = "localhost"
eureka-uri = "http://localhost:7102/v2/vips/local-dev:7001"
instance-uri = "http://{local-ipv4}:{port}"
edda-uri = "http://localhost:7102/api/v1/autoScalingGroups/local-dev:7001"
}
]
// Number of buffers to use for the time grouping. More buffers means that data has
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ private[stream] abstract class EvaluatorImpl(
private def createWebSocketFlow(
instance: EddaSource.Instance
): Flow[Set[LwcExpression], ByteString, NotUsed] = {
val base = instance.substitute("ws://{local-ipv4}:{port}")
val base = instance.substitute("ws://{ip}:{port}")
val id = UUID.randomUUID().toString
val uri = s"$base/api/v$lwcapiVersion/subscribe/$id"
val webSocketFlowOrigin = Http(system).webSocketClientFlow(WebSocketRequest(uri))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ private[stream] class StreamContext(
EddaBackend(
cfg.getString("host"),
eddaUri,
cfg.getString("instance-uri"),
checkForExpensiveQueries
)
}
Expand Down Expand Up @@ -331,7 +330,6 @@ private[stream] object StreamContext {
case class EddaBackend(
host: String,
eddaUri: String,
instanceUri: String,
checkForExpensiveQueries: Boolean = true
) extends Backend {

Expand Down

0 comments on commit aa364b7

Please sign in to comment.