Merge pull request #2527 from chakflying/fix/docker-down

Fix: Fix incorrect handling for container down
This commit is contained in:
Louis Lam 2023-01-04 15:33:59 +08:00 committed by GitHub
commit 2e022789f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -514,7 +514,9 @@ 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) {
bean.status = UP; bean.status = UP;
bean.msg = ""; bean.msg = res.data.State.Status;
} else {
throw Error("Container State is " + res.data.State.Status);
} }
} else if (this.type === "mqtt") { } else if (this.type === "mqtt") {
bean.msg = await mqttAsync(this.hostname, this.mqttTopic, this.mqttSuccessMessage, { bean.msg = await mqttAsync(this.hostname, this.mqttTopic, this.mqttSuccessMessage, {