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

Add page query retries when no match #79

Merged
merged 1 commit into from
Feb 7, 2021
Merged

Conversation

Yikun
Copy link
Contributor

@Yikun Yikun commented Feb 6, 2021

When we do search on related commits of specific repo_name in github, we
perhaps get 200 status_code but no right page result, then get an
unexpected 0 result accidently.

This patch breaks retry loop only when result is 200 status with match
result rather than only 200 status.

@property
def dependents_count(self):
# do query retries when no match to ensure accurate result
for i in range(FAIL_RETRIES):
Copy link
Contributor

Choose a reason for hiding this comment

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

We dont need two FAIL_RETRIES and a seperate function, can you modify the loop to not break on status 200. Break only when status is 200 and there is a match as well [and return directly from inside loop].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, done

When we do search on related commits of specific repo_name in github, we
perhaps get 200 status_code but no right page result, then get an
unexpected 0 result accidently.

This patch breaks retry loop only when result is 200 status with match
result rather than only 200 status.
@Yikun Yikun changed the title Add page query retries when get the 0 dependency Add page query retries when no match Feb 7, 2021
@inferno-chromium inferno-chromium merged commit 6f95b24 into ossf:main Feb 7, 2021
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.

None yet

2 participants