mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Refine VFS watch behavior to support recursive watching
- Updated the `read_raw` method in `VfsInner` to ensure that the file watching behavior is only triggered when both `watch_enabled` and `watch_recursive` are true. This change enhances the control over file watching, particularly in scenarios involving nested directories. These modifications aim to improve the efficiency and accuracy of the VFS's file watching capabilities.
This commit is contained in:
parent
02638535ec
commit
9ddd9379ab
1 changed files with 2 additions and 2 deletions
|
|
@ -179,7 +179,7 @@ impl VfsInner {
|
||||||
fn read_raw(&mut self, path: &Path) -> io::Result<Vec<u8>> {
|
fn read_raw(&mut self, path: &Path) -> io::Result<Vec<u8>> {
|
||||||
if let Some(cache) = &mut self.prefetch_cache {
|
if let Some(cache) = &mut self.prefetch_cache {
|
||||||
if let Some(contents) = cache.files.remove(path) {
|
if let Some(contents) = cache.files.remove(path) {
|
||||||
if self.watch_enabled {
|
if self.watch_enabled && self.watch_recursive {
|
||||||
self.watch_or_record(path)?;
|
self.watch_or_record(path)?;
|
||||||
}
|
}
|
||||||
return Ok(contents);
|
return Ok(contents);
|
||||||
|
|
@ -188,7 +188,7 @@ impl VfsInner {
|
||||||
|
|
||||||
let contents = self.backend.read(path)?;
|
let contents = self.backend.read(path)?;
|
||||||
|
|
||||||
if self.watch_enabled {
|
if self.watch_enabled && self.watch_recursive {
|
||||||
self.watch_or_record(path)?;
|
self.watch_or_record(path)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue