All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gu.management.Healthcheck.scala Maven / Gradle / Ivy

The newest version!
package com.gu.management

class HealthcheckManagementPage(healthcheckSwitch: Switch = Healthcheck.switch) extends ManagementPage {
  val path = "/management/healthcheck"

  def get(req: HttpRequest) = {
    healthcheckSwitch opt {
      PlainTextResponse("OK")
    } getOrElse {
      ErrorResponse(503, "Service unavailable: healthcheck-enable switch is OFF")
    }
  }
}

object Healthcheck {
  val switch = new DefaultSwitch("healthcheck-enable", "Health check enable", initiallyOn = true)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy