Skip to content

repo-updater: Don't delete repos when rate limit exceeded

Administrator requested to merge github-rate-limit-checks into main

Created by: ryanslade

When we perform a repoLookup on sourcegraph.com and discover that we are not able to access a public repo we delete that repo as we assume that it is no longer public. Unfortunately, the GitHub rest API returns a 403 code when rate limit has been exhausted.

To fix this we first check for the special case of rate limit error before falling back check if we have a 403 or 401 error.

This change also recognises when we internally rate limit requests.

Closes: https://github.com/sourcegraph/sourcegraph/issues/16393

Merge request reports

Loading