Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复定时器泄漏导致CPU较高 #24

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"net/http"
_ "net/http/pprof"
"os"
"runtime"

Expand Down
1 change: 1 addition & 0 deletions pkg/provider/aliyun.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions pkg/provider/amazon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions pkg/provider/cloudflare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions pkg/provider/dnsla.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions pkg/provider/godaddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions pkg/provider/tencent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading