Added prefetch
This commit is contained in:
@@ -139,6 +139,11 @@ impl<V: VirtualFileSystem> RemoteFileSystem for RemoteFileSystemImpl<V> {
|
||||
let virt_path = sanitized_to_virt(&safe_path);
|
||||
|
||||
let entries = self.tree.get_snapshot(&virt_path, req.depth).await;
|
||||
let total_entries: usize = entries.iter().map(|(_, v)| v.len()).sum();
|
||||
tracing::debug!(
|
||||
"GetSnapshot: path='{}' depth={} → {} dirs, {} total entries",
|
||||
virt_path, req.depth, entries.len(), total_entries
|
||||
);
|
||||
|
||||
let stream = async_stream::try_stream! {
|
||||
for (path, children) in entries {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user