summaryrefslogtreecommitdiff
path: root/send.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-18 20:22:12 -0600
committerJeff Carr <[email protected]>2024-11-18 20:22:12 -0600
commitafc7fedbe14d22b7090efc970a21686a050d0242 (patch)
tree5d08116134f53cd5cf628c8dd0961d3efda03f2c /send.go
parentb71fec22c8cc6c5b3be47bd782a7c807be75216c (diff)
someday this will workv0.0.7
Diffstat (limited to 'send.go')
-rw-r--r--send.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/send.go b/send.go
index 045c625..ca8889b 100644
--- a/send.go
+++ b/send.go
@@ -10,14 +10,9 @@ import (
"go.wit.com/log"
)
-var urlbase string = "http://zookeeper.grid.wit.com:8080"
-
-func send() {
-}
-
func pingStatus() error {
var url string
- url = urlbase + "/status?hostname=" + me.hostname
+ url = me.urlbase + "/status?hostname=" + me.hostname
msg, err := me.machine.Packages.Marshal()
if err != nil {
log.Info("proto.Marshal() failed:", err)
@@ -45,7 +40,7 @@ func pingStatus() error {
func sendMachine(s string) error {
var url string
- url = urlbase + "/machine"
+ url = me.urlbase + "/machine"
msg, err := me.machine.Marshal()
if err != nil {
log.Info("proto.Marshal() failed:", err)
@@ -62,6 +57,7 @@ func sendMachine(s string) error {
for _, line := range strings.Split(test, "\n") {
if line == "upgrade" {
log.Info(s, "zookeeper is healthy", len(msg))
+ me.failcount = 0
} else if line == "kill" {
os.Exit(0)
} else if strings.HasPrefix(line, "apt update") {
@@ -71,7 +67,7 @@ func sendMachine(s string) error {
log.Sleep(1)
os.Exit(0)
} else {
- log.Info(urlbase, "is maybe not working GOT:", line)
+ log.Info(me.urlbase, "is maybe not working GOT:", line)
}
}
return nil