_DomainState
Index
Methods
apply_backoff
Block the domain for
delay.If no 429 arrives for another
delayafter the domain becomes dispatchable again, the exponent resets.Parameters
now: datetime
delay: timedelta
Returns None
apply_crawl_delay
Block the domain for its crawl-delay, if it declared one.
Parameters
now: datetime
Returns None
is_stall_candidate
Check whether the domain still rate-limits us and has rate-limited every request for longer than
window.Parameters
now: datetime
window: timedelta
Returns bool
reset_throttling
Clear the transient throttle state.
Returns None
Properties
backoff_decays_at
Time after which an incoming 429 is treated as a fresh burst rather than a continuation of the current one.
backoff_until
Earliest time the next request is allowed by the 429 backoff. Kept apart from crawl_delay_until, which is
armed on every dispatch and would otherwise pass for an active backoff.
consecutive_429_count
Number of consecutive 429 responses (for exponential backoff).
crawl_delay
Minimum interval between requests, used to push crawl_delay_until on dispatch.
crawl_delay_until
Earliest time the next request is allowed by the domain's crawl-delay.
domain
The domain being tracked.
last_rate_limited_at
Time of the most recent 429 from the domain.
rate_limited_since
Time of the first 429 since the domain last completed a request.
throttled_until
Earliest time the next request to this domain is allowed by either of its two independent clocks.
Tracks delay state for a single domain.