Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Remove/Fix some compiler warnings #2899

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -20,36 +20,33 @@ object InstrumentationServer {

private val instrumentationServer =
for {
index <- ZIO.service[IndexApp].map(_.route)
health <- ZIO.service[HealthRouteZ].map(_.route)
prometheus <- ZIO.service[PrometheusApp].map(_.route)
index <- ZIO.serviceWith[IndexApp](_.route)
health <- ZIO.serviceWith[HealthRouteZ](_.route)
prometheus <- ZIO.serviceWith[PrometheusApp](_.route)
app = index ++ health ++ prometheus
_ <- Server.serve(app)
_ <- Server.serve(app).forkDaemon
} yield ()

val make: ZIO[State with AppConfig, Throwable, Fiber.Runtime[Throwable, Unit]] =
ZIO
.service[AppConfig]
.flatMap { config =>
val port = config.instrumentationServerConfig.port
val interval = config.instrumentationServerConfig.interval
val metricsConfig = MetricsConfig(interval)
ZIO.logInfo(s"Starting instrumentation http server on port: $port") *>
instrumentationServer
.provideSome[State](
// HTTP Server
Server.defaultWithPort(port),
// HTTP routes
IndexApp.layer,
HealthRouteZ.layer,
PrometheusApp.layer,
// Metrics dependencies
prometheus.publisherLayer,
ZLayer.succeed(metricsConfig) >>> prometheus.prometheusLayer,
Runtime.enableRuntimeMetrics,
Runtime.enableFiberRoots,
DefaultJvmMetrics.live.unit
)
.forkDaemon
}
val make: ZIO[State with AppConfig, Throwable, Unit] =
ZIO.serviceWithZIO[AppConfig] { config =>
val port = config.instrumentationServerConfig.port
val interval = config.instrumentationServerConfig.interval
val metricsConfig = MetricsConfig(interval)
ZIO.logInfo(s"Starting instrumentation http server on port: $port") *>
instrumentationServer
.provideSome[State](
// HTTP Server
Server.defaultWithPort(port),
// HTTP routes
IndexApp.layer,
HealthRouteZ.layer,
PrometheusApp.layer,
// Metrics dependencies
prometheus.publisherLayer,
ZLayer.succeed(metricsConfig) >>> prometheus.prometheusLayer,
Runtime.enableRuntimeMetrics,
Runtime.enableFiberRoots,
DefaultJvmMetrics.live.unit
)
}
}
Expand Up @@ -25,7 +25,6 @@ import org.knora.webapi.slice.admin.domain.service.DspIngestClientMock
import org.knora.webapi.slice.admin.domain.service.ProjectExportServiceStub
import org.knora.webapi.slice.admin.domain.service.ProjectExportStorageServiceLive
import org.knora.webapi.slice.admin.domain.service.ProjectImportServiceLive
import org.knora.webapi.store.triplestore.impl.TriplestoreServiceLive

object ProjectsServiceLiveSpec extends ZIOSpecDefault {

Expand Down Expand Up @@ -62,8 +61,6 @@ object ProjectsServiceLiveSpec extends ZIOSpecDefault {

private def projectServiceLayer(exp: Expectation[ProjectsResponderADM]): ULayer[ProjectADMRestService] =
ZLayer.make[ProjectADMRestService](
TriplestoreServiceLive.layer,
StringFormatter.test,
ProjectsADMRestServiceLive.layer,
exp.toLayer,
org.knora.webapi.slice.common.api.RestPermissionServiceLive.layer,
Expand Down