diff --git a/ghorgs/wrappers.py b/ghorgs/wrappers.py index 24a3a92..42d7f52 100644 --- a/ghorgs/wrappers.py +++ b/ghorgs/wrappers.py @@ -130,7 +130,7 @@ def get_paged_content(self, session: requests.Session, url: str) -> list: all_data = [] current_url = url last_url = None - while last_url != current_url: + while True: response = session.get(current_url) retry_after_raw = response.headers.get('Retry-After', None) if retry_after_raw: @@ -143,6 +143,10 @@ def get_paged_content(self, session: requests.Session, url: str) -> list: assert isinstance(data, list) all_data.extend(data) + # Need to move this check here and change to 'while True' so the last page of the gitbub project will be processed + if current_url == last_url: + break + # check header if 'Link' in response.headers: # parse