Skip to content

Commit

Permalink
Merge pull request #3169 from janow25/docker-health-check
Browse files Browse the repository at this point in the history
Added Docker Health Status Support
  • Loading branch information
louislam authored Jun 30, 2023
2 parents 9ee2780 + f604d96 commit de74efb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions server/model/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,15 @@ class Monitor extends BeanModel {

log.debug("monitor", `[${this.name}] Axios Request`);
let res = await axios.request(options);

if (res.data.State.Running) {
bean.status = UP;
bean.msg = res.data.State.Status;
if (res.data.State.Health && res.data.State.Health.Status !== "healthy") {
bean.status = PENDING;
bean.msg = res.data.State.Health.Status;
} else {
bean.status = UP;
bean.msg = res.data.State.Health ? res.data.State.Health.Status : res.data.State.Status;
}
} else {
throw Error("Container State is " + res.data.State.Status);
}
Expand Down

0 comments on commit de74efb

Please sign in to comment.