Skip to main content

run_watcher

Function run_watcher 

Source
pub async fn run_watcher(
    repo_root: PathBuf,
    shared: SharedIndex,
    watcher_info: Arc<Mutex<WatcherInfo>>,
)
Expand description

Main watcher supervision loop. Spawned as a background tokio task by main.rs.

Lifecycle:

  1. Set state to Active
  2. Loop: start_watcher → process events → restart on error with 1s backoff
  3. After 3 consecutive failures: set state to Degraded and stop