update_lib
Fetches the current watcher count for a GitHub repository via the GitHub API and updates the provided library object with the star count. The function includes a recursive retry mechanism for 403 status codes and performs network I/O using a global session object.
def update_lib(
lib: dict,
retry: int = 0
) - > null
Fetches the current star count for a GitHub repository and updates the provided library object with the result. This function performs an authenticated network request and includes a retry mechanism to handle rate limiting (403 status codes).
Parameters
| Name | Type | Description |
|---|---|---|
| lib | dict | A dictionary representing a library, which must contain a 'repo' key with the GitHub repository path (e.g., 'owner/name'). |
| retry | int = 0 | The current attempt count used to manage recursive retries when encountering GitHub API rate limits. |
Returns
| Type | Description |
|---|---|
null | Nothing; the function modifies the input library dictionary in-place by setting the 'stars' key. |