diff options
author | 2020-10-24 05:37:01 -0700 | |
---|---|---|
committer | 2020-10-24 14:37:01 +0200 | |
commit | 3168a722cac244c91fc56e3a4d1d3d7fd48f0dd2 (patch) | |
tree | 0603f78383a7b7816935ed9590949ade23a29527 /plugin/clouddns/clouddns.go | |
parent | 054c9ae1fbea39d586652664fbc9a5cedbd97618 (diff) | |
download | coredns-3168a722cac244c91fc56e3a4d1d3d7fd48f0dd2.tar.gz coredns-3168a722cac244c91fc56e3a4d1d3d7fd48f0dd2.tar.zst coredns-3168a722cac244c91fc56e3a4d1d3d7fd48f0dd2.zip |
Use cancelable contexts for cloud provider plugin refreshes (#4226)
This commit uses a cancelable context to spawn goroutines that refresh
records from a cloud DNS provider. The Caddy shutdown routine uses the
returned cancel function to terminate existing goroutines when a USR1
reload signal is received.
Signed-off-by: Matt Kulka <mkulka@parchment.com>
Diffstat (limited to 'plugin/clouddns/clouddns.go')
-rw-r--r-- | plugin/clouddns/clouddns.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/clouddns/clouddns.go b/plugin/clouddns/clouddns.go index 3546a4fea..343b4ca53 100644 --- a/plugin/clouddns/clouddns.go +++ b/plugin/clouddns/clouddns.go @@ -85,11 +85,11 @@ func (h *CloudDNS) Run(ctx context.Context) error { for { select { case <-ctx.Done(): - log.Infof("Breaking out of CloudDNS update loop: %v", ctx.Err()) + log.Debugf("Breaking out of CloudDNS update loop for %v: %v", h.zoneNames, ctx.Err()) return case <-time.After(1 * time.Minute): if err := h.updateZones(ctx); err != nil && ctx.Err() == nil /* Don't log error if ctx expired. */ { - log.Errorf("Failed to update zones: %v", err) + log.Errorf("Failed to update zones %v: %v", h.zoneNames, err) } } } |