Skip to content

Commit 8c8fdb4

Browse files
committed
Pass query supervisor actor ref to public api
1 parent 97107b6 commit 8c8fdb4

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

api/src/main/scala/hmda/api/HmdaPublicApi.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ import hmda.api.http.public.{ InstitutionSearchPaths, PublicHttpApi }
1414
import hmda.persistence.model.HmdaSupervisorActor.FindActorByName
1515
import hmda.query.view.institutions.InstitutionView
1616
import akka.http.scaladsl.server.Directives._
17-
import hmda.query.HmdaQuerySupervisor
18-
1917
import scala.concurrent.duration._
2018
import scala.concurrent.{ ExecutionContext, Future }
2119

2220
object HmdaPublicApi {
23-
def props(): Props = Props(new HmdaPublicApi())
21+
def props(querySupervisor: ActorRef): Props = Props(new HmdaPublicApi(querySupervisor))
2422
}
2523

26-
class HmdaPublicApi
24+
class HmdaPublicApi(querySupervisor: ActorRef)
2725
extends HttpApi
2826
with BaseHttpApi
2927
with InstitutionSearchPaths
@@ -43,8 +41,6 @@ class HmdaPublicApi
4341
override implicit val ec: ExecutionContext = context.dispatcher
4442
override val log = Logging(system, getClass)
4543

46-
val querySupervisor = system.actorOf(HmdaQuerySupervisor.props(), "api-query-supervisor")
47-
4844
val institutionViewF = (querySupervisor ? FindActorByName(InstitutionView.name))
4945
.mapTo[ActorRef]
5046

cluster/src/main/scala/hmda/cluster/HmdaPlatform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ object HmdaPlatform extends App {
8484
ClusterHttpManagement(cluster).start()
8585
system.actorOf(HmdaFilingApi.props(supervisorProxy, querySupervisorProxy, validationStatsProxy).withDispatcher("api-dispatcher"), "hmda-filing-api")
8686
system.actorOf(HmdaAdminApi.props(supervisorProxy, querySupervisorProxy).withDispatcher("api-dispatcher"), "hmda-admin-api")
87-
system.actorOf(HmdaPublicApi.props().withDispatcher("api-dispatcher"), "hmda-public-api")
87+
system.actorOf(HmdaPublicApi.props(querySupervisorProxy).withDispatcher("api-dispatcher"), "hmda-public-api")
8888
}
8989

9090
//Start Persistence

0 commit comments

Comments
 (0)