mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-10 19:27:04 +01:00
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / web-coverage (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Todo: 9b9342ba
22 lines
692 B
Python
22 lines
692 B
Python
"""Pacing for HLTB requests.
|
|
|
|
HLTB answers 429 ("Slow your roll!") after about 60 requests in a minute:
|
|
unpaced bursts and a 2 req/s run (2026-11-08) both stopped near 60. A full
|
|
library refresh is ~800 games, so the single request slot
|
|
(``MAX_CONCURRENT``) waits ``REQUEST_INTERVAL_S`` after every request before
|
|
the next one goes out: about 55 requests per minute.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import asyncio
|
|
|
|
REQUEST_INTERVAL_S = 1.1
|
|
# Indirection so tests can drop the wait without touching asyncio itself.
|
|
_sleep = asyncio.sleep
|
|
|
|
|
|
async def pause_after_request() -> None:
|
|
"""Hold the caller's request slot for the pacing interval."""
|
|
await _sleep(REQUEST_INTERVAL_S)
|