diff --git a/respodns/dns.py b/respodns/dns.py index 4debcd5..ab6c137 100644 --- a/respodns/dns.py +++ b/respodns/dns.py @@ -169,8 +169,7 @@ async def try_ip(db, server_ip, checks, context, opts: Options, callback=None): await sem.acquire() if not success: break - task = create_task(process(check)) - tasks.append(task) + tasks.append(create_task(process(check))) for task in tasks: try: await task @@ -225,8 +224,7 @@ async def try_all_ips(db, try_me, checks, context, opts: Options, callback=None) # acquire now instead of within the task so # a ton of tasks aren't created all at once. await sem.acquire() - task = create_task(process(ip)) - tasks.append(task) + tasks.append(create_task(process(ip))) for task in tasks: await task