You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by gc...@apache.org on 2025/09/16 03:04:10 UTC
(allura) branch gc/github_paginate created (now fd1ba33b6)
This is an automated email from the ASF dual-hosted git repository.
gcruz pushed a change to branch gc/github_paginate
in repository https://gitbox.apache.org/repos/asf/allura.git
at fd1ba33b6 add a pagination flag to prevent hitting the github api rate limit on imports with lots of commits
This branch includes the following new commits:
new fd1ba33b6 add a pagination flag to prevent hitting the github api rate limit on imports with lots of commits
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(allura) 01/01: add a pagination flag to prevent hitting the github api rate limit on imports with lots of commits
Posted by gc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gcruz pushed a commit to branch gc/github_paginate
in repository https://gitbox.apache.org/repos/asf/allura.git
commit fd1ba33b682dd92a65a7df7aa70ce14bc4a7ee13
Author: Guillermo Cruz <gu...@slashdotmedia.com>
AuthorDate: Mon Sep 15 21:04:02 2025 -0600
add a pagination flag to prevent hitting the github api rate limit on imports with lots of commits
---
ForgeImporters/forgeimporters/github/__init__.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/ForgeImporters/forgeimporters/github/__init__.py b/ForgeImporters/forgeimporters/github/__init__.py
index 6e2019e5d..adb9085b8 100644
--- a/ForgeImporters/forgeimporters/github/__init__.py
+++ b/ForgeImporters/forgeimporters/github/__init__.py
@@ -149,14 +149,15 @@ def parse_page(self, page):
next_page_url = self.get_next_page_url(link)
return json.loads(page.read().decode('utf8')), next_page_url
- def get_page(self, page_name_or_url, **kw):
+ def get_page(self, page_name_or_url, do_pagination=True, **kw):
page = super().get_page(
page_name_or_url, **kw)
page, next_page_url = page
- while next_page_url:
- p = super().get_page(next_page_url, **kw)
- p, next_page_url = p
- page += p
+ if do_pagination:
+ while next_page_url:
+ p = super().get_page(next_page_url, **kw)
+ p, next_page_url = p
+ page += p
self.page = page
return self.page