mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Add is_watch_enabled method to VFS and enhance prefetch cache tests
- Introduced `is_watch_enabled` method to check the status of automatic file watching in the VFS. - Added a new test for prefetch cache to validate metadata retrieval and error handling for walked roots and external paths. - Updated the `watch` method in `StdBackend` for cleaner logic. - Enhanced the `dir_init` field in `PrefetchCache` to store resolved init-file information for directories, improving prefetch operations.
This commit is contained in:
parent
8b18dc451a
commit
5275d45adc
6 changed files with 91 additions and 9 deletions
|
|
@ -39,6 +39,6 @@ pub use snapshot::{
|
|||
InstanceContext, InstanceMetadata, InstanceSnapshot, InstanceWithMeta, InstanceWithMetaMut,
|
||||
RojoDescendants, RojoTree,
|
||||
};
|
||||
pub use snapshot_middleware::{snapshot_from_vfs, Middleware, ScriptType};
|
||||
pub use snapshot_middleware::{snapshot_from_vfs, Middleware, ScriptType, INIT_FILE_PRIORITY};
|
||||
pub use syncback::{syncback_loop, FsSnapshot, SyncbackData, SyncbackResult, SyncbackSnapshot};
|
||||
pub use web::interface as web_api;
|
||||
|
|
|
|||
|
|
@ -349,9 +349,10 @@ impl ServeSession {
|
|||
|
||||
let snap_start = Instant::now();
|
||||
log::trace!("Generating snapshot of instances from VFS");
|
||||
let was_watch_enabled = vfs.is_watch_enabled();
|
||||
vfs.set_watch_enabled(false);
|
||||
let snapshot = snapshot_from_vfs(&instance_context, vfs, start_path)?;
|
||||
vfs.set_watch_enabled(true);
|
||||
vfs.set_watch_enabled(was_watch_enabled);
|
||||
log::debug!("Snapshot built in {:.1?}", snap_start.elapsed());
|
||||
|
||||
vfs.clear_prefetch_cache();
|
||||
|
|
|
|||
|
|
@ -544,6 +544,12 @@ mod test {
|
|||
"DEFAULT_PROJECT_NAMES entry {project_name:?} missing from INIT_FILE_PRIORITY"
|
||||
);
|
||||
}
|
||||
for &name in &priority_names {
|
||||
assert!(
|
||||
DEFAULT_PROJECT_NAMES.contains(&name),
|
||||
"INIT_FILE_PRIORITY has Project entry {name:?} not in DEFAULT_PROJECT_NAMES"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue