mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2026-12-03 09:36:11 +00:00
fix(dns): 在查询前终止非正超时
This commit is contained in:
1 parent
26308c6101
commit
7a2f2bcdb2
1 file changed
+6
@@ -189,6 +189,12 @@ func runTimedDNSWork(
|
||||
cleanup func(),
|
||||
work func(context.Context) error,
|
||||
) error {
|
||||
if totalTimeout <= 0 {
|
||||
stdout.disable()
|
||||
stderr.disable()
|
||||
cleanup()
|
||||
return normalizeRunError(context.DeadlineExceeded, totalTimeout)
|
||||
}
|
||||
baseCtx, cancel := context.WithCancel(parent)
|
||||
defer cancel()
|
||||
extensions := make(chan time.Duration)
|
||||
|
||||
Reference in new issue
Block a user