Skip to content

Commit

Permalink
Merge branch '3.0.x' into 3.1.x
Browse files Browse the repository at this point in the history
Closes gh-37510
  • Loading branch information
mhalbritter committed Sep 21, 2023
2 parents b1ff3b8 + 454342a commit aabd6f5
Showing 1 changed file with 6 additions and 11 deletions.
Expand Up @@ -33,17 +33,12 @@ class MyHealthMetricsExportConfiguration(registry: MeterRegistry, healthEndpoint
}

private fun getStatusCode(health: HealthEndpoint): Int {
val status = health.health().status
if (Status.UP == status) {
return 3
}
if (Status.OUT_OF_SERVICE == status) {
return 2
}
if (Status.DOWN == status) {
return 1
}
return 0
return when (health.health().status) {
Status.UP -> 3
Status.OUT_OF_SERVICE -> 2
Status.DOWN -> 1
else -> 0
}
}

}

0 comments on commit aabd6f5

Please sign in to comment.