From 9654ad1e3b8984cc62ca3b7b1d274c0c86d40b80 Mon Sep 17 00:00:00 2001 From: eryajf Date: Mon, 28 Oct 2024 20:54:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E5=99=A8=E6=B3=84=E6=BC=8F=E5=AF=BC=E8=87=B4CPU=E8=BE=83?= =?UTF-8?q?=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/cmd/root.go | 1 + pkg/provider/aliyun.go | 1 + pkg/provider/amazon.go | 1 + pkg/provider/cloudflare.go | 1 + pkg/provider/dnsla.go | 1 + pkg/provider/godaddy.go | 1 + pkg/provider/tencent.go | 1 + 7 files changed, 7 insertions(+) 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) {