mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-02-25 08:51:16 -05:00
make DOWN the default fallback for docker container healthcheck
This commit is contained in:
parent
7f5dfcc051
commit
0b478404cf
@ -770,15 +770,20 @@ class Monitor extends BeanModel {
|
|||||||
let res = await axios.request(options);
|
let res = await axios.request(options);
|
||||||
|
|
||||||
if (res.data.State.Running) {
|
if (res.data.State.Running) {
|
||||||
if (res.data.State.Health && ![ "healthy", "unhealthy", "" ].includes(res.data.State.Health.Status)) {
|
if (res.data.State.Health) {
|
||||||
bean.status = PENDING;
|
if ([ "", "healthy" ].includes(res.data.State.Health.Status)) {
|
||||||
bean.msg = res.data.State.Health.Status;
|
bean.status = UP;
|
||||||
} else if (res.data.State.Health && res.data.State.Health.Status === "unhealthy") {
|
bean.msg = res.data.State.Health.Status;
|
||||||
bean.status = DOWN;
|
} else if (res.data.State.Health.Status === "starting") {
|
||||||
bean.msg = res.data.State.Health.Status;
|
bean.status = PENDING;
|
||||||
|
bean.msg = res.data.State.Health.Status;
|
||||||
|
} else {
|
||||||
|
bean.status = DOWN;
|
||||||
|
bean.msg = res.data.State.Health.Status;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
bean.status = UP;
|
bean.status = DOWN;
|
||||||
bean.msg = res.data.State.Health ? res.data.State.Health.Status : res.data.State.Status;
|
bean.msg = res.data.State.Status;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw Error("Container State is " + res.data.State.Status);
|
throw Error("Container State is " + res.data.State.Status);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user