Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HomayoonAlimohammadi committed Apr 5, 2024
1 parent 2765325 commit 2398289
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
16 changes: 8 additions & 8 deletions internal/resolver/dns/dns_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ var (
// MinResolutionRate is the minimum rate at which re-resolutions are
// allowed. This helps to prevent excessive re-resolution.
MinResolutionRate = 30 * time.Second
)

// ResolvingTimeout specifies the maximum duration for a DNS resolution request.
// If the timeout expires before a response is received, the request will be canceled.
//
// It is recommended to set this value at application startup. Avoid modifying this variable
// after initialization as it's not thread-safe for concurrent modification.
var ResolvingTimeout = 30 * time.Second
// ResolvingTimeout specifies the maximum duration for a DNS resolution request.
// If the timeout expires before a response is received, the request will be canceled.
//
// It is recommended to set this value at application startup. Avoid modifying this variable
// after initialization as it's not thread-safe for concurrent modification.
ResolvingTimeout = 30 * time.Second

var logger = grpclog.Component("dns")
logger = grpclog.Component("dns")
)

func init() {
resolver.Register(NewBuilder())
Expand Down
4 changes: 2 additions & 2 deletions internal/resolver/dns/dns_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func overrideNetResolver(t *testing.T, r *testNetResolver) {
// Override the DNS Min Res Rate used by the resolver.
func overrideResolutionRate(t *testing.T, d time.Duration) {
origMinResRate := dns.MinResolutionRate
dns.MinResolutionRate = d
t.Cleanup(func() { dns.MinResolutionRate = origMinResRate })
dnspublic.SetMinResolutionRate(d)
t.Cleanup(func() { dnspublic.SetMinResolutionRate(origMinResRate) })
}

// Override the timer used by the DNS resolver to fire after a duration of d.
Expand Down
3 changes: 0 additions & 3 deletions resolver/dns/dns_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ func NewBuilder() resolver.Builder {

// SetMinResolutionRate sets the default minimum rate at which DNS re-resolutions are
// allowed. This helps to prevent excessive re-resolution.
//
// Using this option overwrites the default [MinResolutionRate] specified
// in the internal dns resolver package.
func SetMinResolutionRate(d time.Duration) {
dns.MinResolutionRate = d
}

0 comments on commit 2398289

Please sign in to comment.