Skip to content

Commit 1fdb76a

Browse files
committed
fixed total steps in download progress
1 parent b9b4af7 commit 1fdb76a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tmc-langs/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,6 @@ pub fn download_or_update_course_exercises(
160160
);
161161

162162
let exercises_details = client.get_exercises_details(exercises)?;
163-
let exercises_len = exercises_details.len();
164-
progress_reporter::start_stage::<()>(
165-
exercises_len * 2 + 1, // each download progresses at 2 points, plus the final finishing step
166-
format!("Downloading {} exercises", exercises_len),
167-
None,
168-
);
169-
170163
let mut projects_config = ProjectsConfig::load(projects_dir)?;
171164

172165
// separate exercises into downloads and skipped
@@ -238,6 +231,13 @@ pub fn download_or_update_course_exercises(
238231
});
239232
}
240233

234+
let exercises_len = to_be_downloaded.len();
235+
progress_reporter::start_stage::<()>(
236+
exercises_len * 2 + 1, // each download progresses at 2 points, plus the final finishing step
237+
format!("Downloading {} exercises", exercises_len),
238+
None,
239+
);
240+
241241
log::debug!("downloading exercises");
242242
// download and divide the results into successful and failed downloads
243243
let thread_count = to_be_downloaded.len().min(4); // max 4 threads

0 commit comments

Comments
 (0)