Move health check to domain layer
This commit is contained in:
+3
-3
@@ -1,6 +1,6 @@
|
||||
package be.simplenotes.app.controllers
|
||||
|
||||
import be.simplenotes.persistance.DbHealthCheck
|
||||
import be.simplenotes.domain.usecases.HealthCheckService
|
||||
import org.http4k.core.Request
|
||||
import org.http4k.core.Response
|
||||
import org.http4k.core.Status.Companion.OK
|
||||
@@ -8,7 +8,7 @@ import org.http4k.core.Status.Companion.SERVICE_UNAVAILABLE
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class HealthCheckController(private val dbHealthCheck: DbHealthCheck) {
|
||||
class HealthCheckController(private val healthCheckService: HealthCheckService) {
|
||||
fun healthCheck(@Suppress("UNUSED_PARAMETER") request: Request) =
|
||||
if (dbHealthCheck.isOk()) Response(OK) else Response(SERVICE_UNAVAILABLE)
|
||||
if (healthCheckService.isOk()) Response(OK) else Response(SERVICE_UNAVAILABLE)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user