Skip to content

Commit

Permalink
📝 update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Nov 15, 2024
1 parent 0a61bcf commit 0208b92
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/usage/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ github = GitHub(
timeout=None,
cache_strategy=None,
http_cache=True,
throttler=None,
auto_retry=True,
rest_api_validate_body=True,
)
Expand All @@ -35,6 +36,7 @@ config = Config(
timeout=httpx.Timeout(None),
cache_strategy=DEFAULT_CACHE_STRATEGY,
http_cache=True,
throttler=None,
auto_retry=RETRY_DEFAULT,
rest_api_validate_body=True,
)
Expand Down Expand Up @@ -82,6 +84,14 @@ Available built-in cache strategies:

The `http_cache` option enables the http caching feature powered by [Hishel](https://hishel.com/) for HTTPX. GitHub API limits the number of requests that you can make within a specific amount of time. This feature is useful to reduce the number of requests to GitHub API and avoid hitting the rate limit.

### `throttler`

The `throttler` option is used to control the request concurrency to avoid hitting the rate limit. You can provide a githubkit built-in throttler or a custom one that implements the `BaseThrottler` interface. By default, githubkit uses the `LocalThrottler` to control the request concurrency.

Available built-in throttlers:

- `LocalThrottler`: Control the request concurrency in the local process / event loop.

### `auto_retry`

The `auto_retry` option enables request retrying when rate limit exceeded and server error encountered. See [Auto Retry](./auto-retry.md) for more infomation.
Expand Down

0 comments on commit 0208b92

Please sign in to comment.