Skip to content

Commit 1fd5680

Browse files
committed
fix: asset copy counter
1 parent 7d490dc commit 1fd5680

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/cli/src/build/bundle.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ impl AppBundle {
437437
}
438438

439439
let asset_count = assets_to_transfer.len();
440-
let assets_finished = AtomicUsize::new(0);
440+
let current_asset = AtomicUsize::new(0);
441441

442442
// Parallel Copy over the assets and keep track of progress with an atomic counter
443443
let progress = self.build.progress.clone();
@@ -448,7 +448,7 @@ impl AppBundle {
448448
.try_for_each(|(from, to, options)| {
449449
tracing::trace!(
450450
"Starting asset copy {current}/{asset_count} from {from:?}",
451-
current = assets_finished.fetch_add(0, std::sync::atomic::Ordering::SeqCst),
451+
current = current_asset.fetch_add(1, std::sync::atomic::Ordering::SeqCst),
452452
);
453453

454454
let res = process_file_to(options, from, to);
@@ -459,7 +459,7 @@ impl AppBundle {
459459

460460
BuildRequest::status_copied_asset(
461461
&progress,
462-
assets_finished.fetch_add(1, std::sync::atomic::Ordering::SeqCst) + 1,
462+
current_asset.fetch_add(0, std::sync::atomic::Ordering::SeqCst),
463463
asset_count,
464464
from.to_path_buf(),
465465
);

0 commit comments

Comments
 (0)