Skip to content

Commit

Permalink
conditionally raise stopiteration after yielding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elfkuzco committed Aug 7, 2024
1 parent b082510 commit 1dfd89a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker/manager/src/mirrors_qa_manager/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@ def fetch_tests(self) -> Iterable[dict[str, str]]:
f"Fetched page {current_page} of {last_page} of pending tests."
)

yield from data["tests"]

if current_page == last_page:
raise StopIteration

yield from data["tests"]

def sleep(self) -> None:
logger.info(f"Sleeping for {Settings.SLEEP_SECONDS}s")
time.sleep(Settings.SLEEP_SECONDS)
Expand Down

0 comments on commit 1dfd89a

Please sign in to comment.