File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
src/main/scala/de/upb/cs/swt/delphi/webapi Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,8 @@ class Configuration( //Server and Elasticsearch configuration
5757 case Some (_) => true
5858 case None => false
5959 }
60- lazy val assignedID : Option [Long ] = InstanceRegistry .register(configuration = this ) match {
61- case Success (id) => Some (id)
62- case Failure (_) => None
63- }
60+ lazy val assignedID : Option [Long ] = InstanceRegistry .handleInstanceStart(configuration = this )
61+
6462 lazy val fallbackElasticSearchPort : Int = sys.env.get(" DELPHI_ELASTIC_URI" ) match {
6563 case Some (hostString) => if (hostString.count(c => c == ':' ) == 3 ){
6664 Try (hostString.split(" :" )(2 ).toInt) match {
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ package de.upb.cs.swt.delphi.webapi
22
33import java .util .concurrent .TimeUnit
44
5- import akka .actor .ActorSystem
5+ import akka .Done
6+ import akka .actor .{ActorSystem , PoisonPill }
7+ import akka .http .scaladsl .Http
68import akka .http .scaladsl .server .HttpApp
79import akka .pattern .ask
810import akka .stream .ActorMaterializer
@@ -17,7 +19,7 @@ import spray.json._
1719
1820import scala .concurrent .duration .Duration
1921import scala .concurrent .{Await , ExecutionContext }
20- import scala .util .{Failure , Success }
22+ import scala .util .{Failure , Success , Try }
2123
2224/**
2325 * Web server configuration for Delphi web API.
@@ -110,7 +112,7 @@ object Server extends HttpApp with JsonSupport with AppLogging {
110112 Await .ready(f, Duration .Inf )
111113
112114 Server .startServer(configuration.bindHost, configuration.bindPort)
113- InstanceRegistry .deregister (configuration)
115+ InstanceRegistry .handleInstanceStop (configuration)
114116 system.terminate()
115117 }
116118
You can’t perform that action at this time.
0 commit comments