summaryrefslogtreecommitdiff
path: root/poll.go
diff options
context:
space:
mode:
Diffstat (limited to 'poll.go')
-rw-r--r--poll.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/poll.go b/poll.go
index 12c07af..24f1dad 100644
--- a/poll.go
+++ b/poll.go
@@ -48,10 +48,6 @@ func (h *HyperT) pollHypervisor() {
d.CurrentState = "ON"
d.lastpoll = time.Now()
- // this means the droplet is still where it was before
- if d.h.pb.Hostname == h.pb.Hostname {
- continue
- }
if d.h == nil {
// this means the droplet was in the config file
@@ -65,6 +61,14 @@ func (h *HyperT) pollHypervisor() {
}
log.Log(EVENT, "new droplet", d.pb.Hostname, "on", h.pb.Hostname, "(in config file without preferred hypervisor)")
+ d.h = h
+ continue
+ }
+
+ // this means the droplet is still where it was before
+ if d.h.pb.Hostname != h.pb.Hostname {
+ log.Log(EVENT, "droplet", d.h.pb.Hostname, "moved to", h.pb.Hostname)
+ continue
}
d.h = h
}