From c11f5336378fa6d263261bc5d97d1272fe511caf Mon Sep 17 00:00:00 2001 From: Gaius Date: Mon, 12 May 2025 23:47:02 +0800 Subject: [PATCH] feat(dragonfly-client): add logs for finished piece from local (#1147) Signed-off-by: Gaius --- dragonfly-client-config/src/dfdaemon.rs | 2 +- dragonfly-client/src/resource/piece.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dragonfly-client-config/src/dfdaemon.rs b/dragonfly-client-config/src/dfdaemon.rs index 32d0ad84..d9c67104 100644 --- a/dragonfly-client-config/src/dfdaemon.rs +++ b/dragonfly-client-config/src/dfdaemon.rs @@ -149,7 +149,7 @@ fn default_download_piece_timeout() -> Duration { /// default_download_concurrent_piece_count is the default number of concurrent pieces to download. #[inline] fn default_download_concurrent_piece_count() -> u32 { - 16 + 8 } /// default_download_max_schedule_count is the default max count of schedule. diff --git a/dragonfly-client/src/resource/piece.rs b/dragonfly-client/src/resource/piece.rs index 5adc5d21..f5a2adcc 100644 --- a/dragonfly-client/src/resource/piece.rs +++ b/dragonfly-client/src/resource/piece.rs @@ -422,6 +422,7 @@ impl Piece { // If the piece is downloaded by the other thread, // return the piece directly. if piece.is_finished() { + info!("finished piece {} from local", piece_id); return Ok(piece); } @@ -525,6 +526,7 @@ impl Piece { // If the piece is downloaded by the other thread, // return the piece directly. if piece.is_finished() { + info!("finished piece {} from local", piece_id); return Ok(piece); } @@ -789,6 +791,7 @@ impl Piece { // If the piece is downloaded by the other thread, // return the piece directly. if piece.is_finished() { + info!("finished persistent cache piece {} from local", piece_id); return Ok(piece); }