diff options
| author | Jeff Carr <[email protected]> | 2024-10-27 11:02:50 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-27 11:02:50 -0500 |
| commit | 8fc2fbd9c9a6f05852cd597b246f0b4e634af7d7 (patch) | |
| tree | 707c6044781eb4ef1f3ed9c4b756f6e605e4b6c8 /main.go | |
| parent | d38865a6cf3d9e11803e9f565a0dd0c763de479d (diff) | |
track droplets reported from each hypervisor
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -38,16 +38,17 @@ func main() { } // set defaults - me.unstable = time.Now() // initialize the grid as unstable - me.delay = 5 * time.Second // how often to poll the hypervisors + me.unstable = time.Now() // initialize the grid as unstable me.changed = false - // me.dmap = make(map[*pb.Droplet]*DropletT) me.hmap = make(map[*pb.Hypervisor]*HyperT) // how long a droplet can be missing until it's declared dead me.unstableTimeout = 17 * time.Second me.missingDropletTimeout = time.Minute // not sure the difference between these values + // how often to poll the hypervisors + me.hyperPollDelay = 5 * time.Second + // how long the cluster must be stable before new droplets can be started me.clusterStableDuration = 37 * time.Second @@ -141,12 +142,14 @@ func main() { log.Println("result:", result) os.Exit(0) } + // initialize each hypervisor for _, pbh := range me.cluster.Hypervisors { // this is a new unknown droplet (not in the config file) - h := new(HyperT) + var h *HyperT + h = new(HyperT) h.pb = pbh - + h.lastDroplets = make(map[string]time.Time) h.lastpoll = time.Now() me.hmap[pbh] = h |
