Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor github issues fetching #1009

Merged
merged 1 commit into from
Jan 20, 2021
Merged

refactor github issues fetching #1009

merged 1 commit into from
Jan 20, 2021

Conversation

deniak
Copy link
Member

@deniak deniak commented Jan 20, 2021

  • refactoring github issues fetching
  • cleanup indentation

function getAllData (repo, doc) {
let arr = [];
for (let p=1; p < maxpages+1; p++) {
arr.push(fetch('https://api.github.com/repos/w3c/'+repo+'/issues?per_page=100&page='+p));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we need to check return code and throw custom error, that fetch does not throw error on 403/404 etc.
(also might be better to check maximum number of pages like #855 rather than using fixed number?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it would be good to check the errors and go through all the pages. In that PR, I was just trying to fix the race condition issue for the snapshot generation.

@r12a r12a merged commit 4e1ecc1 into gh-pages Jan 20, 2021
@r12a r12a deleted the refactoring branch January 20, 2021 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants