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

perf: query 100 projects instead of 20 #983

Merged
merged 1 commit into from
Jul 20, 2020

Conversation

lorenzo-cavazzi
Copy link
Member

We should query for 100 projects per page instead of 20 to prevent unnecessary multiple queries.

Screenshot_20200720_113154

Not a big change tbf, but I noticed that the current limit per page is pretty low and we end up making way more queries than necessary.

We should query for 100 projects per page instead of 20 to prevent unnecessary queries.
@lorenzo-cavazzi lorenzo-cavazzi requested a review from a team as a code owner July 20, 2020 09:44
Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

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

This change is fine. This PR brought my attention to this code, which is a bit confusing and messy. We should make another issue to refactor this function, and maybe merge with getProjects.

@lorenzo-cavazzi lorenzo-cavazzi merged commit c6fced4 into master Jul 20, 2020
@lorenzo-cavazzi lorenzo-cavazzi deleted the 000-projects-per-page branch July 20, 2020 21:21
@ciyer ciyer added this to the sprint-2020-07-09 milestone Jul 29, 2020
ciyer pushed a commit that referenced this pull request Sep 9, 2020
Change the default per_page parameter from 20 to 100 when invoking the GET /projects endpoint from GitLab to prevent unnecessary queries.

(cherry picked from commit c6fced4)
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.

2 participants