mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Throttle requests to mitigate RateLimitExceededExceptions (#2145)
This introduces a throttling of requests to the Github REST API (1s for writes, 0.25s for reads, configurable) to mitigate secondary rate limit errors and comply with Github's best practices: https://docs.github.com/en/rest/guides/best-practices-for-integrators?apiVersion=2022-11-28#dealing-with-secondary-rate-limits
This commit is contained in:
@@ -18,12 +18,15 @@ class GithubIntegration:
|
||||
integration_id: Optional[Union[int, str]] = ...,
|
||||
private_key: Optional[str] = ...,
|
||||
base_url: str = ...,
|
||||
*,
|
||||
timeout: int = ...,
|
||||
user_agent: str = ...,
|
||||
per_page: int = ...,
|
||||
verify: Union[bool, str] = ...,
|
||||
retry: Optional[Union[int, Retry]] = ...,
|
||||
pool_size: Optional[int] = ...,
|
||||
seconds_between_requests: Optional[float] = ...,
|
||||
seconds_between_writes: Optional[float] = ...,
|
||||
jwt_expiry: int = ...,
|
||||
jwt_issued_at: int = ...,
|
||||
jwt_algorithm: str = ...,
|
||||
|
||||
Reference in New Issue
Block a user