Skip to content

Commit e4d4347

Browse files
committed
comment about caveat of current transfer rate refresh
1 parent 9df531b commit e4d4347

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cargo/sources/git/utils.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,16 @@ pub fn with_fetch_options(
712712
)
713713
} else {
714714
// Receiving objects.
715+
//
716+
// # Caveat
717+
//
718+
// Progress bar relies on git2 calling `transfer_progress`
719+
// to update its transfer rate, but we cannot guarantee a
720+
// periodic call of that callback. Thus if we don't receive
721+
// any data for, say, 10 seconds, the rate will get stuck
722+
// and never go down to 0B/s.
723+
// In the future, we need to find away to update the rate
724+
// even when the callback is not called.
715725
let now = Instant::now();
716726
// Scrape a `received_bytes` to the counter every 300ms.
717727
if now - last_update > Duration::from_millis(300) {

0 commit comments

Comments
 (0)