Skip to content

Commit 5fff061

Browse files
author
archiegugol
committed
Fix for missing projects on last page
1 parent de4b09f commit 5fff061

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ghorgs/wrappers.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def get_paged_content(self, session: requests.Session, url: str) -> list:
130130
all_data = []
131131
current_url = url
132132
last_url = None
133-
while last_url != current_url:
133+
while True:
134134
response = session.get(current_url)
135135
retry_after_raw = response.headers.get('Retry-After', None)
136136
if retry_after_raw:
@@ -143,14 +143,16 @@ def get_paged_content(self, session: requests.Session, url: str) -> list:
143143
assert isinstance(data, list)
144144
all_data.extend(data)
145145

146+
# Archie> Need to add this check here so last page will be processed
147+
if current_url == last_url:
148+
break
149+
146150
# check header
147151
if 'Link' in response.headers:
148152
# parse
149153
parsed_link_header = parse_github_link_header(response.headers['Link'])
150154
current_url = parsed_link_header['next']
151155
last_url = parsed_link_header['last']
152-
else:
153-
last_url = current_url
154156
return all_data
155157

156158

0 commit comments

Comments
 (0)