From 505ba68d618f0678dbcf92d514cb6c68c0563031 Mon Sep 17 00:00:00 2001 From: jakka Date: Thu, 17 Jul 2025 12:51:40 +0300 Subject: waiting for threads to finish work --- src/files.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/files.rs b/src/files.rs index 849de77..8db0f64 100644 --- a/src/files.rs +++ b/src/files.rs @@ -186,6 +186,10 @@ pub fn reencode_files(conn: Connection, handler: Arc, threads: usize }); } + while *thread_counter.read().unwrap() != 0 { + sleep(time::Duration::from_millis(100)); + } + #[cfg(not(test))] { if handler.load(Ordering::SeqCst) { -- cgit v1.3.1