diff --git a/hosts.go b/hosts.go index 6469174..734c6d2 100644 --- a/hosts.go +++ b/hosts.go @@ -30,7 +30,11 @@ func NewHosts(hs HostsSettings, rs RedisSettings) Hosts { providers = append(providers, NewRedisProvider(rc, hs.RedisKey)) } - return Hosts{providers, time.Second * time.Duration(hs.RefreshInterval)} + h := Hosts{providers, time.Second * time.Duration(hs.RefreshInterval)} + + h.refresh() + + return h } func (h *Hosts) refresh() {