diff options
| author | Jeff Carr <[email protected]> | 2024-10-26 20:09:59 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-26 20:09:59 -0500 |
| commit | 3c1efcba0e6d5757aea38b0c2067fdbb26be8105 (patch) | |
| tree | fbc91a529cbee31a72ffc303fc1cf9da2fc36449 /event.go | |
| parent | 7837182d532dcc022ca2ffafa9289640ac942195 (diff) | |
start worked by sending protobuf
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'event.go')
| -rw-r--r-- | event.go | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -51,6 +51,8 @@ func dropletReady(d *pb.Droplet) (bool, string) { return true, "" } +// this must be bool in string because accumulated output is sometimes +// written to STDOUT, sometimes to http func (h *HyperT) start(d *pb.Droplet) (bool, string) { ready, result := clusterReady() if !ready { @@ -62,9 +64,19 @@ func (h *HyperT) start(d *pb.Droplet) (bool, string) { } url := "http://" + h.pb.Hostname + ":2520/start?start=" + d.Hostname - s := shell.Wget(url) + var msg string + var data []byte + msg = d.FormatJSON() + data = []byte(msg) // Convert the string to []byte + req, err := httpPost(url, data) + if err != nil { + return false, fmt.Sprintln("error:", err) + } + log.Info("http post url:", url) + log.Info("http post data:", msg) + result = "EVENT start droplet url: " + url + "\n" - result += "EVENT start droplet response: " + s.String() + result += "EVENT start droplet response: " + string(req) // increment the counter for a start attempt working d.Starts += 1 @@ -99,7 +111,7 @@ func Start(name string) (bool, string) { dur := time.Since(me.unstable) // how long has the cluster been stable? result = fmt.Sprintln("should start droplet", name, "here. grid stable for:", shell.FormatDuration(dur)) - if dur < 17*time.Second { + if dur < me.unstableTimeout { result += "grid is still too unstable" return false, result } |
