From 3457be7942b661788e0032da65cc0e528583913b Mon Sep 17 00:00:00 2001 From: Tyler Date: Sun, 5 Aug 2018 00:22:37 -0400 Subject: [PATCH] Force initial refresh --- hosts.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() {