Skip to main content

resolve_rate_limit_with

Function resolve_rate_limit_with 

Source
pub fn resolve_rate_limit_with(bin: &Path) -> Result<RateLimitSnapshot>
Expand description

Resolves the current rate-limit snapshot in one gh api rate_limit call, using the gh at bin.

The binary is a parameter rather than resolved here so callers read the environment once (the poller does it at spawn) and so tests inject a stub without mutating the process environment — the same discipline as crate::pr_status::resolve_with. Reuse crate::pr_status::resolve_gh_binary to obtain bin.

Blocking — run on a blocking thread. A missing, unauthenticated, or failing gh yields Err, which the poller logs and shrugs off (keeping the last good snapshot); querying /rate_limit spends nothing, so this call never affects the budget it reports.