Skip to content

Commit

Permalink
avoid consuming iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Sep 30, 2024
1 parent f7ea011 commit 591ca0d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/aiohappyeyeballs/_staggered.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,16 @@ async def run_one_coro(
start_next_timer = loop.call_later(delay, _set_result, start_next)
else:
start_next_timer = None
else:
start_next = None
if not tasks:
break
elif not tasks:
break

while tasks:
if start_next:
done = await _wait_one([*tasks, start_next], loop)
if done is start_next:
# The current task has failed or the timer has expired
# so we need to start the next task.
start_next = None
if start_next_timer:
start_next_timer.cancel()
start_next_timer = None
Expand Down

0 comments on commit 591ca0d

Please sign in to comment.