mirror of
https://github.com/safing/portmaster
synced 2025-09-16 01:39:41 +00:00
Switch resolver pooling to use sync.Pool
This commit is contained in:
parent
36c60a1e33
commit
c8223f1a63
4 changed files with 41 additions and 81 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue