Merge pull request #19077 from ktoso/wip-jenkins-autobahn-ktoso
=htc #18563 fix access to props
This commit is contained in:
commit
8dfcd46830
1 changed files with 7 additions and 6 deletions
|
|
@ -19,9 +19,10 @@ object WSServerAutobahnTest extends App {
|
|||
implicit val system = ActorSystem("WSServerTest")
|
||||
implicit val fm = ActorMaterializer()
|
||||
|
||||
val host = sys.env.getOrElse("akka.ws-host", "127.0.0.1")
|
||||
val port = sys.env.getOrElse("akka.ws-port", "9001").toInt
|
||||
val mode = sys.env.getOrElse("akka.ws-mode", "read") // read or sleep
|
||||
val props = sys.props
|
||||
val host = props.getOrElse("akka.ws-host", "127.0.0.1")
|
||||
val port = props.getOrElse("akka.ws-port", "9001").toInt
|
||||
val mode = props.getOrElse("akka.ws-mode", "read") // read or sleep
|
||||
|
||||
try {
|
||||
val binding = Http().bindAndHandleSync({
|
||||
|
|
@ -38,9 +39,9 @@ object WSServerAutobahnTest extends App {
|
|||
Await.result(binding, 3.second) // throws if binding fails
|
||||
println(s"Server online at http://${host}:${port}")
|
||||
mode match {
|
||||
case "sleep" => while (true) Thread.sleep(1.minute.toMillis)
|
||||
case "read" => Console.readLine("Press RETURN to stop...")
|
||||
case _ => throw new Exception("akka.ws-mode MUST be sleep or read.")
|
||||
case "sleep" ⇒ while (true) Thread.sleep(1.minute.toMillis)
|
||||
case "read" ⇒ Console.readLine("Press RETURN to stop...")
|
||||
case _ ⇒ throw new Exception("akka.ws-mode MUST be sleep or read.")
|
||||
}
|
||||
} finally {
|
||||
system.shutdown()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue