From 44e2a491a052284904198c0e2966d9aa6e842d16 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 14 Aug 2021 17:42:22 -0700 Subject: [PATCH] merge a couple lines --- respodns/dns.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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