diff options
| author | Jeff Carr <[email protected]> | 2024-10-31 17:00:34 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-31 17:00:34 -0500 |
| commit | 3562fc780eb94b3bd341b1ae5cbbf69fb71148a5 (patch) | |
| tree | 906f24bfe55c70df9596c437132ce868b92f9c2c | |
| parent | b28ae96cd4c2801968ed883814b83357b77ed144 (diff) | |
ready to trigger importDomain()
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | poll.go | 40 |
1 files changed, 23 insertions, 17 deletions
@@ -36,15 +36,18 @@ func (h *HyperT) pollHypervisor() { if state == "OFF" { d := me.cluster.FindDropletByName(name) if d == nil { - log.Log(WARN, "locally defined domain:", h.pb.Hostname, fields) - log.Log(WARN, "neeed to add a local droplet protobuf") + log.Log(WARN, "local", h.pb.Hostname, name, "locally defined domain") + log.Log(WARN, "local", h.pb.Hostname, name, "Running AddDropletLocal()") + log.Log(WARN, "local", h.pb.Hostname, name, "Running AddDropletLocal()") + log.Log(WARN, "local", h.pb.Hostname, name, "Running AddDropletLocal()") me.cluster.AddDropletLocal(name, h.pb.Hostname) return } if d.LocalOnly == "" { - log.Log(WARN, "ready to import", d.Hostname, "from", h.pb.Hostname) + log.Log(WARN, "local", h.pb.Hostname, name, "duplicate defined (need to resolve this)") + continue } - log.Log(WARN, "duplicate local droplet", h.pb.Hostname, fields, "need to resolve this") + log.Log(WARN, "local", h.pb.Hostname, name, "ready to import from hypervisor") continue } h.lastDroplets[name] = time.Now() @@ -156,23 +159,16 @@ func uptimeCheck() (bool, string) { continue } dur := time.Since(d.Current.LastPoll.AsTime()) // Calculate the elapsed time - if d.Current.State == pb.DropletState_UNKNOWN { - // log.Info("SKIP. hostname has not been polled yet", d.Hostname, d.hname) - unknown += 1 - unknownList = append(unknownList, d.Hostname) - continue - } var hname string if d.Current.Hypervisor != "" { hname = d.Current.Hypervisor } - if d.Current.State != pb.DropletState_ON { - log.Info("BAD STATE", d.StartState, d.Hostname, hname, "Current.State =", d.Current.State, shell.FormatDuration(dur)) - good = false - failed += 1 - missing = append(missing, d) - } else { - dur := time.Since(d.Current.LastPoll.AsTime()) // Calculate the elapsed time + switch d.Current.State { + case pb.DropletState_UNKNOWN: + // log.Info("SKIP. hostname has not been polled yet", d.Hostname, d.hname) + unknown += 1 + unknownList = append(unknownList, d.Hostname) + case pb.DropletState_ON: if dur > me.missingDropletTimeout { log.Info("GOOD STATE MISSING", d.Hostname, hname, shell.FormatDuration(dur)) good = false @@ -188,6 +184,16 @@ func uptimeCheck() (bool, string) { } working += 1 // log.Info("GOOD STATE ON", d.Hostname, d.hname, "dur =", l) + case pb.DropletState_OFF: + log.Info("OFF STATE", d.StartState, d.Hostname, hname, shell.FormatDuration(dur)) + good = false + failed += 1 + // missing = append(missing, d) + default: + log.Info("WTF STATE", d.StartState, d.Hostname, hname, "Current.State =", d.Current.State, shell.FormatDuration(dur)) + good = false + failed += 1 + missing = append(missing, d) } } var summary string = "(" |
