Skip to main content

kick_background_fetch

Function kick_background_fetch 

Source
fn kick_background_fetch(cwd: &Path, default_branch: &str, budget: Duration)
Expand description

Kick a throttled, non-blocking base refresh so the remote-tracking ref the branch-ahead layer compares against is fresher for the NEXT scan. Only fires for a remote-tracking default (origin/...); a purely-local default has no remote to fetch. Failures log from fetch_base, which owns the one fetch path with its flags and lock line.

Nobody waits on this refresh, and it may not spend a reader’s wait: a drawing read that arrives while it runs answers what it already holds and lets this run’s answer serve the next read (see refresh_base_for_display) rather than joining it. A second kick for the same repository joins the run rather than fetching again, and budget bounds the run, so a hung remote cannot leave a child behind.

scan_within is the one scan that can serve a seat with no loop: its record read would otherwise re-read the tree for ever against a ref nothing ever refreshes.