Refactor watcher mutex handling and add tests

This commit is contained in:
thePR0M3TH3AN
2025-05-21 09:23:14 -04:00
parent 3880442e2a
commit 3fb6504cb0
5 changed files with 119 additions and 49 deletions

View File

@@ -199,7 +199,7 @@ impl Marlin {
let watcher_db = Arc::new(Mutex::new(db::Database::new(new_conn)));
let mut owned_w = watcher::FileWatcher::new(vec![p], cfg)?;
owned_w.with_database(watcher_db); // Modifies owned_w in place
owned_w.with_database(watcher_db)?; // Modifies owned_w in place
owned_w.start()?; // Start the watcher after it has been fully configured
Ok(owned_w) // Return the owned FileWatcher