feat: review cbr and unraring for image on api

This commit is contained in:
2026-03-07 15:47:46 +01:00
parent 162b4712e7
commit 360d6e85de
6 changed files with 85 additions and 93 deletions

View File

@@ -186,7 +186,6 @@ async fn run_file_watcher(state: AppState) -> anyhow::Result<()> {
let pool = state.pool.clone();
tokio::spawn(async move {
let mut watcher: Option<RecommendedWatcher> = None;
let mut watched_libraries: HashMap<Uuid, String> = HashMap::new();
loop {
@@ -217,17 +216,12 @@ async fn run_file_watcher(state: AppState) -> anyhow::Result<()> {
if needs_restart {
info!("[WATCHER] Restarting watcher for {} libraries", current_libraries.len());
// Drop old watcher
watcher = None;
watched_libraries.clear();
if !current_libraries.is_empty() {
let tx_clone = tx.clone();
let libraries_clone = current_libraries.clone();
match setup_watcher(libraries_clone, tx_clone) {
Ok(new_watcher) => {
watcher = Some(new_watcher);
Ok(_new_watcher) => {
watched_libraries = current_libraries;
info!("[WATCHER] Watching {} libraries", watched_libraries.len());
}