useful-forks / useful-forks.github.io

Improving GitHub's Forks list discoverability through automatic filtering. The project offers an online tool and a Chrome extension.
https://useful-forks.github.io/
MIT License
1.18k stars 61 forks source link

Support resuming #53

Open przemoc opened 1 year ago

przemoc commented 1 year ago

I did run useful-forks on repo that has >5000 forks, and naturally got GitHub API rate-limits exceeded. It would be nice if there would be a way (button?) to resume scanning after waiting long enough to be no longer blocked on API calls. I tried editing access token to re-save it, but it did not resume activities.

payne911 commented 1 year ago

This would be a great addition. I'd need to dig some more into the octokit library code to better understand some things.

On the surface, however, after a quick research, it seems like I might have made a little implementation mistake at this location:

https://github.com/useful-forks/useful-forks.github.io/blob/90dc02a951c78792b630b07fd584b2543b8f60b5/website/src/queries-logic.js#L337-L342

I think I could increase the retry count, and the RATE_LIMIT_EXCEEDED variable may need to somehow be reset to false once a request succeeds (because right now I seem to be doing an early-abort):

https://github.com/useful-forks/useful-forks.github.io/blob/90dc02a951c78792b630b07fd584b2543b8f60b5/website/src/queries-logic.js#L120-L124

I'll probably get back on it eventually, but feel free to dig into it yourself and provide a PR if you want this feature to be implemented quickly. :)

Side-note: additionally, that retry should probably also display that timer slider animation.