Rust Octocrab API Reliably Stops Returning Pages #120038
Unanswered
Pspritechologist
asked this question in
API and Webhooks
Replies: 1 comment 1 reply
-
GITHUB_TOKEN= page=1 while true; do if [ -z "$response" ]; then Output the responseecho "$response" echo "Done with page #$page" ((page++)) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Question
Body
I'm writing an app to mirror PRs from repo A into repo B. To do so, the bot needs to collect all PRs made to repo A. I've written it using the Rust crate Octocrab, which has been working fine for the most part.
The issue I'm running into is during the loop where I'm collecting each page (using the 'next page' link provided in the response), at a certain point the function call just hangs and doesn't respond at all. This is reliably at page 56-59, although not a consistent single page.
I've confirmed this issue occurs over multiple repositories, one of which being the
microsoft/winget-pkgs
repo.Below is the code I'm using to do this, albeit simplified due to lack of context.
It hangs on the
octocrab.get_page
line, after page number 56-59 as said before. I am absolutely stumped on what could be the cause.The issue is not solved either by including a 30 second wait after obtaining 50 pages, nor by including a few second long wait between each page. Starting from page 50 did not stop at the same page.
I'm pretty new to using APIs like this in general, and completely new to the GitHub one. I'm also rather new to Rust :P
Any help is greatly appreciated.
(For context, this originally contained a shell script that I thought displayed similar issues, but it seemed I was making an unrelated mistake there. I've instead left the Rust code that is causing me issues.)
Beta Was this translation helpful? Give feedback.
All reactions