Browse Source

🔨 Update FastAPI People sleep interval, use external settings (#13888)

pull/13806/merge
Sebastián Ramírez 1 day ago
committed by GitHub
parent
commit
ce26b8e1ca
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      .github/workflows/people.yml
  2. 3
      scripts/people.py

1
.github/workflows/people.yml

@ -51,3 +51,4 @@ jobs:
run: python ./scripts/people.py
env:
GITHUB_TOKEN: ${{ secrets.FASTAPI_PEOPLE }}
SLEEP_INTERVAL: ${{ vars.PEOPLE_SLEEP_INTERVAL }}

3
scripts/people.py

@ -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…
Cancel
Save