Skip to content

Commit

Permalink
fix: asset copy counter
Browse files Browse the repository at this point in the history
  • Loading branch information
jkelleyrtp committed Dec 7, 2024
1 parent 7d490dc commit 1fd5680
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/build/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand All @@ -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(),
);
Expand Down

0 comments on commit 1fd5680

Please sign in to comment.