refactor: remove unnecessary file system operations

This commit is contained in:
Jamie Pine
2025-12-03 18:00:43 -08:00
parent 0b22a7aec4
commit 52cd817bf0
2 changed files with 21 additions and 13 deletions

View File

@@ -359,7 +359,11 @@ impl ResourceManager {
e
))
})?,
metadata: None,
metadata: Some(ResourceMetadata {
no_merge_fields: vec!["resolved_file".to_string()],
alternate_ids: vec![],
affected_paths: vec![],
}),
});
}
}

View File

@@ -206,19 +206,23 @@ async fn test_single_interruption_point(
info!("Cleaning up database lock files...");
let library_dir = test_setup.data_dir().join("libraries");
if library_dir.exists() {
for entry in std::fs::read_dir(&library_dir)? {
let entry = entry?;
let path = entry.path();
if path.is_dir() {
// Remove SQLite WAL and SHM files
let db_path = path.join("library.db");
let wal_path = path.join("library.db-wal");
let shm_path = path.join("library.db-shm");
if let Ok(entries) = std::fs::read_dir(&library_dir) {
for entry in entries {
if let Ok(entry) = entry {
let path = entry.path();
if path.is_dir() {
// Remove SQLite WAL and SHM files
let wal_path = path.join("library.db-wal");
let shm_path = path.join("library.db-shm");
for lock_file in [wal_path, shm_path] {
if lock_file.exists() {
if let Err(e) = std::fs::remove_file(&lock_file) {
warn!("Failed to remove {}: {}", lock_file.display(), e);
for lock_file in [wal_path, shm_path] {
if lock_file.exists() {
if let Err(e) = std::fs::remove_file(&lock_file) {
warn!("Failed to remove {}: {}", lock_file.display(), e);
} else {
info!("Removed lock file: {}", lock_file.display());
}
}
}
}
}