diff options
-rw-r--r-- | CHANGELOG.md | 7 | ||||
-rw-r--r-- | src/aggregate.rs | 20 |
2 files changed, 17 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ae245f..cb2cfcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -#### v2.12 +#### v2.12.1 + +* Fixed bug that would cause `dua` to unconditionally sleep for 1 second. This sleep was intended for a spawned thread, + but it slipped into the main thread. + +#### v2.12.0 [YANKED] * Add minimal progress for when `dua` invocations take longer than 1 second diff --git a/src/aggregate.rs b/src/aggregate.rs index 3d3ac2d..dacaaa7 100644 --- a/src/aggregate.rs +++ b/src/aggregate.rs @@ -40,15 +40,17 @@ pub fn aggregate( if let Some(mut err) = err { thread::spawn({ let shared_count = Arc::clone(&shared_count); - thread::sleep(Duration::from_secs(1)); - move || loop { - thread::sleep(Duration::from_millis(100)); - write!( - err, - "Enumerating {} entries\r", - shared_count.load(Ordering::Acquire) - ) - .ok(); + move || { + thread::sleep(Duration::from_secs(1)); + loop { + thread::sleep(Duration::from_millis(100)); + write!( + err, + "Enumerating {} entries\r", + shared_count.load(Ordering::Acquire) + ) + .ok(); + } } }); } |