fix: asset copy counter

This commit is contained in:
Jonathan Kelley committed 2024-12-06 18:00:16 -08:00
1 parent 7d490dc3bd
commit 1fd5680937
1 file changed
+3 -3
+3 -3
View File
@@ -437,7 +437,7 @@ impl AppBundle {
}
let asset_count = assets_to_transfer.len();
let assets_finished = AtomicUsize::new(0);
let current_asset = AtomicUsize::new(0);
// Parallel Copy over the assets and keep track of progress with an atomic counter
let progress = self.build.progress.clone();
@@ -448,7 +448,7 @@ impl AppBundle {
.try_for_each(|(from, to, options)| {
tracing::trace!(
"Starting asset copy {current}/{asset_count} from {from:?}",
current = assets_finished.fetch_add(0, std::sync::atomic::Ordering::SeqCst),
current = current_asset.fetch_add(1, std::sync::atomic::Ordering::SeqCst),
);
let res = process_file_to(options, from, to);
@@ -459,7 +459,7 @@ impl AppBundle {
BuildRequest::status_copied_asset(
&progress,
assets_finished.fetch_add(1, std::sync::atomic::Ordering::SeqCst) + 1,
current_asset.fetch_add(0, std::sync::atomic::Ordering::SeqCst),
asset_count,
from.to_path_buf(),
);