Added prefetch

This commit is contained in:
2026-03-13 18:23:26 +00:00
parent 9c55dce5a1
commit ec4bbd2c8c
3 changed files with 66 additions and 19 deletions

View File

@@ -34,11 +34,15 @@ impl WatchedTree {
let (change_tx, _) = broadcast::channel(BROADCAST_CAPACITY);
// Build snapshot, collect the absolute paths that were walked so we can watch them.
info!("WatchedTree: walking '{}' (depth {})…", root.display(), INITIAL_DEPTH);
let t = std::time::Instant::now();
let watched_dirs = walk_tree(&root, INITIAL_DEPTH, &snapshot).await;
let snap_len = snapshot.read().await.len();
info!(
"WatchedTree: snapshot ready ({} directories, {} inotify watches)",
snapshot.read().await.len(),
"WatchedTree: snapshot ready {} directories, {} inotify watches, took {:.1}s",
snap_len,
watched_dirs.len(),
t.elapsed().as_secs_f32(),
);
// Bridge notify's sync callback → async tokio task.