Switch resolver pooling to use sync.Pool
This commit is contained in:
@@ -14,8 +14,6 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
mtAsyncResolve = "async resolve"
|
||||
|
||||
// basic errors
|
||||
|
||||
// ErrNotFound is a basic error that will match all "not found" errors
|
||||
@@ -160,7 +158,7 @@ func checkCache(ctx context.Context, q *Query) *RRCache {
|
||||
log.Tracer(ctx).Trace("resolver: serving from cache, requesting new")
|
||||
|
||||
// resolve async
|
||||
module.StartLowPriorityMicroTask(&mtAsyncResolve, func(ctx context.Context) error {
|
||||
module.StartWorker("resolve async", func(ctx context.Context) error {
|
||||
_, _ = resolveAndCache(ctx, q)
|
||||
return nil
|
||||
})
|
||||
@@ -220,11 +218,6 @@ func resolveAndCache(ctx context.Context, q *Query) (rrCache *RRCache, err error
|
||||
return nil, ErrNoCompliance
|
||||
}
|
||||
|
||||
// prep
|
||||
lastFailBoundary := time.Now().Add(
|
||||
-time.Duration(nameserverRetryRate()) * time.Second,
|
||||
)
|
||||
|
||||
// start resolving
|
||||
|
||||
var i int
|
||||
|
||||
Reference in New Issue
Block a user