Skip to content

Commit

Permalink
fix github api iter
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Dec 17, 2024
1 parent fe60b05 commit 3045165
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions breathecode/services/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,14 @@ def get_org_repos(
page = 0
while True:
page += 1
res = self.get(
f"/orgs/{organization}/repos?page={page}&type={type}&per_page={per_page}&sort={sort}&direction={direction}"
)

try:
res = self.get(
f"/orgs/{organization}/repos?page={page}&type={type}&per_page={per_page}&sort={sort}&direction={direction}"
)

except Exception:
break

if len(res) == 0:
break
Expand Down Expand Up @@ -203,7 +208,12 @@ def get_repo_events(
page = 0
while True:
page += 1
res = self.get(f"/repos/{owner}/{repo}/events?page={page}&per_page={per_page}")

try:
res = self.get(f"/repos/{owner}/{repo}/events?page={page}&per_page={per_page}")

except Exception:
break

if len(res) == 0:
break
Expand Down

0 comments on commit 3045165

Please sign in to comment.