Skip to content

Commit ab381ee

Browse files
authored
📝 update docs
1 parent 47ce1a7 commit ab381ee

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

docs/usage/getting-started/reusing-client.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
githubkit manages an underlying [HTTPX](https://www.python-httpx.org/) client for making HTTP requests. You can use a **context manager** to ensure the HTTP client is properly created, reused, and closed when you're done.
44

5+
<!-- https://github.com/yanyongyu/githubkit/issues/285 -->
6+
7+
!!! warning
8+
9+
We strongly recommend **using the context manager** for any workload that makes multiple API calls or long running processes. Repeatedly creating new HTTP clients may lead to **memory leaks**.
10+
511
## Using the Context Manager
612

713
Wrapping your `GitHub` instance in a `with` (sync) or `async with` (async) block creates a single HTTP client that is shared across all requests made inside that block, and automatically closed on exit:
@@ -42,9 +48,3 @@ from githubkit import GitHub
4248
github = GitHub("<your_token_here>")
4349
resp = github.rest.repos.get(owner="owner", repo="repo")
4450
```
45-
46-
<!-- https://github.com/yanyongyu/githubkit/issues/285 -->
47-
48-
!!! warning
49-
50-
Repeatedly creating new HTTP clients may lead to **memory leaks**. We strongly recommend **using the context manager** for any workload that makes multiple API calls or long running processes.

0 commit comments

Comments
 (0)