diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go index b50ab17..4a38a9b 100644 --- a/pkg/cmd/root.go +++ b/pkg/cmd/root.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "net/http" + _ "net/http/pprof" "os" "runtime" diff --git a/pkg/provider/aliyun.go b/pkg/provider/aliyun.go index 5f2d173..de7215b 100644 --- a/pkg/provider/aliyun.go +++ b/pkg/provider/aliyun.go @@ -115,6 +115,7 @@ func (a *AliyunDNS) ListRecords() ([]Record, error) { } results := make(map[string][]*alidns.DescribeDomainRecordsResponseBodyDomainRecordsRecord) ticker := time.NewTicker(100 * time.Millisecond) + defer ticker.Stop() for _, domain := range domains { wg.Add(1) go func(domain string) { diff --git a/pkg/provider/amazon.go b/pkg/provider/amazon.go index 7e6c623..901e44a 100644 --- a/pkg/provider/amazon.go +++ b/pkg/provider/amazon.go @@ -66,6 +66,7 @@ func (a *AmazonDNS) ListDomains() ([]Domain, error) { return nil, err } ticker := time.NewTicker(100 * time.Millisecond) + defer ticker.Stop() for _, domain := range domains { wg.Add(1) go func(domain types.HostedZone) { diff --git a/pkg/provider/cloudflare.go b/pkg/provider/cloudflare.go index c5a9883..06cb3ad 100644 --- a/pkg/provider/cloudflare.go +++ b/pkg/provider/cloudflare.go @@ -54,6 +54,7 @@ func (cf *CloudFlareDNS) ListDomains() ([]Domain, error) { return nil, err } ticker := time.NewTicker(100 * time.Millisecond) + defer ticker.Stop() for _, domain := range domains { wg.Add(1) go func(domain cloudflare.Zone) { diff --git a/pkg/provider/dnsla.go b/pkg/provider/dnsla.go index 9d3c707..6cdc97a 100644 --- a/pkg/provider/dnsla.go +++ b/pkg/provider/dnsla.go @@ -100,6 +100,7 @@ func (d *DNSLaDNS) ListRecords() ([]Record, error) { } results := make(map[string][]dnsla.Record) ticker := time.NewTicker(time.Second) + defer ticker.Stop() for _, domain := range domains { wg.Add(1) go func(domainName, domainId string) { diff --git a/pkg/provider/godaddy.go b/pkg/provider/godaddy.go index 35df812..703f2f4 100644 --- a/pkg/provider/godaddy.go +++ b/pkg/provider/godaddy.go @@ -101,6 +101,7 @@ func (g *GodaddyDNS) ListRecords() ([]Record, error) { } results := make(map[string][]daddy.DNSRecord) ticker := time.NewTicker(time.Second) + defer ticker.Stop() for _, domain := range domains { wg.Add(1) go func(domain string) { diff --git a/pkg/provider/tencent.go b/pkg/provider/tencent.go index 915d7a6..966f5a9 100644 --- a/pkg/provider/tencent.go +++ b/pkg/provider/tencent.go @@ -114,6 +114,7 @@ func (t *TencentCloudDNS) ListRecords() ([]Record, error) { } results := make(map[string][]*dnspod.RecordListItem) ticker := time.NewTicker(100 * time.Millisecond) + defer ticker.Stop() for _, domain := range domains { wg.Add(1) go func(domain string) {