mirror of https://github.com/tiangolo/fastapi.git
🔨 Update FastAPI People sleep interval, use external settings (#13888)
This commit is contained in:
parent
313723494b
commit
ce26b8e1ca
|
|
@ -51,3 +51,4 @@ jobs:
|
|||
run: python ./scripts/people.py
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.FASTAPI_PEOPLE }}
|
||||
SLEEP_INTERVAL: ${{ vars.PEOPLE_SLEEP_INTERVAL }}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ class Settings(BaseSettings):
|
|||
github_token: SecretStr
|
||||
github_repository: str
|
||||
httpx_timeout: int = 30
|
||||
sleep_interval: int = 5
|
||||
|
||||
|
||||
def get_graphql_response(
|
||||
|
|
@ -184,7 +185,7 @@ def get_discussion_nodes(settings: Settings) -> list[DiscussionsNode]:
|
|||
discussion_nodes.append(discussion_edge.node)
|
||||
last_edge = discussion_edges[-1]
|
||||
# Handle GitHub secondary rate limits, requests per minute
|
||||
time.sleep(5)
|
||||
time.sleep(settings.sleep_interval)
|
||||
discussion_edges = get_graphql_question_discussion_edges(
|
||||
settings=settings, after=last_edge.cursor
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue