summaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-22 17:27:24 -0500
committerJeff Carr <[email protected]>2024-10-22 17:27:24 -0500
commit673bcc6cc9e4504ff707d6cef7575eb1ce152e7c (patch)
treec4f56d6a146a94c3df163f0a8208409e66a83f56 /http.go
parent3b64d342d290d1bea1a8f6edee11fa35997a79c5 (diff)
start migration to protobufs
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'http.go')
-rw-r--r--http.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/http.go b/http.go
index 81266cc..158d346 100644
--- a/http.go
+++ b/http.go
@@ -28,10 +28,10 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
}
dur := time.Since(d.lastpoll) // Calculate the elapsed time
if d.CurrentState != "ON" {
- fmt.Fprintln(w, "BAD STATE ", d.Hostname, d.hname, "(", d.ConfigState, "vs", d.CurrentState, ")", shell.FormatDuration(dur))
+ fmt.Fprintln(w, "BAD STATE ", d.pb.Hostname, d.hname, "(", d.ConfigState, "vs", d.CurrentState, ")", shell.FormatDuration(dur))
} else {
dur := time.Since(d.lastpoll) // Calculate the elapsed time
- fmt.Fprintln(w, "GOOD STATE ON", d.Hostname, d.hname, shell.FormatDuration(dur))
+ fmt.Fprintln(w, "GOOD STATE ON", d.pb.Hostname, d.hname, shell.FormatDuration(dur))
}
}
return
@@ -51,20 +51,20 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, s)
}
for _, h := range me.hypers {
- url := "http://" + h.Hostname + ":2520/kill"
+ url := "http://" + h.pb.Hostname + ":2520/kill"
dur := time.Since(h.lastpoll) // Calculate the elapsed time
if dur > 90*time.Second {
h.RestartDaemon()
continue
}
if h.killcount != 0 {
- log.Info("KILL count =", h.killcount, "FOR", h.Hostname, dur, "curl", url)
+ log.Info("KILL count =", h.killcount, "FOR", h.pb.Hostname, dur, "curl", url)
}
if h.killcount > 10 {
- log.Info("KILL count is greater than 10 for host", h.Hostname, dur, "curl", url)
+ log.Info("KILL count is greater than 10 for host", h.pb.Hostname, dur, "curl", url)
}
// l := shell.FormatDuration(dur)
- // log.Warn("HOST =", h.Hostname, "Last poll =", l)
+ // log.Warn("HOST =", h.pb.Hostname, "Last poll =", l)
//if d.ConfigState != "ON" {
// continue
//}