Skip to content

Commit 7f1d15a

Browse files
committed
added break condnition on generator
1 parent 2ffc687 commit 7f1d15a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/update_top_ranking_issues.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import itertools
23
from datetime import datetime, timedelta
34

45
from github import Github
@@ -38,7 +39,7 @@ def main():
3839
)
3940
issues = github.search_issues(query)
4041

41-
# Format markdown
42+
# Format
4243
ranked_issues = []
4344
# Continuous number generator for the numbered list, starts at 1
4445
index_generator = itertools.count(1)
@@ -49,6 +50,8 @@ def main():
4950

5051
# Get numbered list item index from generator
5152
i = next(index_generator)
53+
if i >= MAX_ISSUES:
54+
break
5255

5356
markdown_bullet_point: str = (
5457
f"{issue.html_url} " +

0 commit comments

Comments
 (0)