Skip to content

Commit

Permalink
remove unncessary stopiteration errors in generator function
Browse files Browse the repository at this point in the history
  • Loading branch information
elfkuzco committed Aug 7, 2024
1 parent 1dfd89a commit 95c2609
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 @@ -300,7 +300,7 @@ def fetch_tests(self) -> Iterable[dict[str, str]]:
data = self.query_api(f"/tests?{params}")
nb_tests = data["metadata"]["page_size"]
if nb_tests == 0: # No more pending tests to fetch
raise StopIteration
break

logger.info(f"Fetched {nb_tests} test(s) from Backend API")

Expand All @@ -314,7 +314,7 @@ def fetch_tests(self) -> Iterable[dict[str, str]]:
yield from data["tests"]

if current_page == last_page:
raise StopIteration
break

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

0 comments on commit 95c2609

Please sign in to comment.