mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-10 15:42:10 +03:00
⚡ Optimize system DNS resolution with asyncio.gather
Replaced sequential system DNS resolution in collect_dns_advanced with concurrent execution using asyncio.gather. This addresses a latency bottleneck when resolving multiple control names. Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
This commit is contained in:
parent
053eb2f530
commit
27007bf412
1 changed files with 3 additions and 1 deletions
|
|
@ -141,7 +141,9 @@ async def collect_dns_advanced(
|
|||
bogus_probe_name: str,
|
||||
timeout: float,
|
||||
) -> DnsAdvanced:
|
||||
system_probes = [await resolve_system(name, timeout) for name in control_names]
|
||||
system_probes = list(
|
||||
await asyncio.gather(*(resolve_system(name, timeout) for name in control_names))
|
||||
)
|
||||
doh_probes: list[ResolverProbe] = []
|
||||
for name in control_names:
|
||||
doh_probes.extend(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue