aboutsummaryrefslogtreecommitdiff
path: root/plugin/azure/azure.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/azure/azure.go')
-rw-r--r--plugin/azure/azure.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugin/azure/azure.go b/plugin/azure/azure.go
index 6b4aba0cc..ed83a0af7 100644
--- a/plugin/azure/azure.go
+++ b/plugin/azure/azure.go
@@ -84,12 +84,16 @@ func (h *Azure) Run(ctx context.Context) error {
return err
}
go func() {
+ delay := 1 * time.Minute
+ timer := time.NewTimer(delay)
+ defer timer.Stop()
for {
+ timer.Reset(delay)
select {
case <-ctx.Done():
log.Debugf("Breaking out of Azure update loop for %v: %v", h.zoneNames, ctx.Err())
return
- case <-time.After(1 * time.Minute):
+ case <-timer.C:
if err := h.updateZones(ctx); err != nil && ctx.Err() == nil {
log.Errorf("Failed to update zones %v: %v", h.zoneNames, err)
}