Apply suggestions for docker compose healthcheck

Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
Vojtěch Fošnár 2024-01-18 09:45:32 +01:00 committed by Louis Lam
parent 0b0f081a13
commit 2ba9337342
1 changed files with 4 additions and 7 deletions

View File

@ -771,13 +771,10 @@ class Monitor extends BeanModel {
if (res.data.State.Running) {
if (res.data.State.Health) {
if ([ "", "healthy" ].includes(res.data.State.Health.Status)) {
bean.status = UP;
// treat empty Status as healthy to support podman: https://github.com/louislam/uptime-kuma/issues/3767
const containerIsHealthy = [ "", "healthy" ].includes(res.data.State.Health.Status);
bean.status = containerIsHealthy ? UP : DOWN;
bean.msg = res.data.State.Health.Status;
} else {
bean.status = DOWN;
bean.msg = res.data.State.Health.Status;
}
} else {
bean.status = DOWN;
bean.msg = res.data.State.Status;