@@ -283,6 +283,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
283
283
// and then immediately return.
284
284
let mut error = None ;
285
285
let total = self . queue . len ( ) ;
286
+ let mut finished = 0 ;
286
287
loop {
287
288
// Dequeue as much work as we can, learning about everything
288
289
// possible that can run. Note that this is also the point where we
@@ -320,7 +321,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
320
321
// unnecessarily.
321
322
let events: Vec < _ > = self . rx . try_iter ( ) . collect ( ) ;
322
323
let events = if events. is_empty ( ) {
323
- self . show_progress ( total) ;
324
+ self . show_progress ( finished , total) ;
324
325
vec ! [ self . rx. recv( ) . unwrap( ) ]
325
326
} else {
326
327
events
@@ -355,6 +356,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
355
356
// from the `active` map ...
356
357
Artifact :: All => {
357
358
info ! ( "end: {:?}" , id) ;
359
+ finished += 1 ;
358
360
self . active . remove ( & id) . unwrap ( )
359
361
}
360
362
// ... otherwise if it hasn't finished we leave it
@@ -431,8 +433,7 @@ impl<'a, 'cfg> JobQueue<'a, 'cfg> {
431
433
}
432
434
}
433
435
434
- fn show_progress ( & mut self , total : usize ) {
435
- let count = total - self . queue . len ( ) - self . active . len ( ) ;
436
+ fn show_progress ( & mut self , count : usize , total : usize ) {
436
437
let active_names = self
437
438
. active
438
439
. values ( )
0 commit comments