Skip to content

repo-updater: Move rate limiters into code host clients

Administrator requested to merge source-rate-limit into master

Created by: ryanslade

This change introduces a new 'Limiter' interface in the the 'ratelimit' package with both a blocking and non blocking implementation.

The underlying rate limiter should still be acquired from the rate limit registry to ensure they are shared across different clients in the same instance. Once acquired, it can be used to create either a blocking or non blocking version which is then passed to our GitHub and Bitbucket clients and will be checked before making any client requests.

The goal of this change is to remove the need to manually check the rate limiter and opens up the path to enable rate limiter for all our other Source implementations here:

https://github.com/sourcegraph/sourcegraph/blob/0f893caf2d091c8ebdef49d35cc5a29e30d113d1/cmd/repo-updater/repos/sources.go#L78

Part of: https://github.com/sourcegraph/sourcegraph/issues/9953

Merge request reports

Loading