Skip to content

Commit

Permalink
fix(prism-agent): reuse db connection for background job (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
patlo-iog committed Nov 9, 2022
1 parent 9cd1faa commit a873090
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ object Modules {
val didCommServiceEndpoint: Task[Nothing] = {
val app: HttpApp[Any, Nothing] =
Http.collect[Request] { case Method.POST -> !! / "did-comm-v2" =>
// TODO add DIDComm messages parsing logic here!
// TODO add DIDComm messages parsing logic here!
Response.text("Hello World!").setStatus(Status.Accepted)
}
Server.start(8090, app)
}

val didCommExchangesJob: Task[Unit] = {
val effect = BackgroundJobs.didCommExchanges
val didCommExchangesJob: Task[Unit] =
BackgroundJobs.didCommExchanges
.repeat(Schedule.spaced(10.seconds))
.unit
.provideLayer(AppModule.credentialServiceLayer)
(effect repeat Schedule.spaced(10.seconds)).unit
}

}

Expand Down Expand Up @@ -191,7 +191,6 @@ object HttpModule {
}

val layers =

didApiLayer ++ didOperationsApiLayer ++ didAuthenticationApiLayer ++ didRegistrarApiLayer ++ issueCredentialsApiLayer ++ issueCredentialsProtocolApiLayer
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import akka.http.scaladsl.server.Route
object HttpRoutes {

def routes: URIO[
DIDApi & DIDOperationsApi & DIDAuthenticationApi & DIDRegistrarApi & IssueCredentialsApi & IssueCredentialsProtocolApi,
DIDApi & DIDOperationsApi & DIDAuthenticationApi & DIDRegistrarApi & IssueCredentialsApi &
IssueCredentialsProtocolApi,
Route
] =
for {
Expand Down

0 comments on commit a873090

Please sign in to comment.