فهرست منبع

fix: asset copy counter

Jonathan Kelley 6 ماه پیش
والد
کامیت
1fd5680937
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      packages/cli/src/build/bundle.rs

+ 3 - 3
packages/cli/src/build/bundle.rs

@@ -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(),
                     );