Skip to content

Commit 4a6ab32

Browse files
committed
fix(cardano-chain-follower): thread stat calling
Signed-off-by: bkioshn <[email protected]>
1 parent 68dfa90 commit 4a6ab32

File tree

2 files changed

+3
-16
lines changed
  • rust/cardano-chain-follower/src

2 files changed

+3
-16
lines changed

rust/cardano-chain-follower/src/stats/thread/name.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ pub(crate) const VALIDATE_MITHRIL_SNAPSHOT: &str = "ValidateMithrilSnapshot";
1818
pub(crate) const MITHRIL_DL_DEDUP: &str = "MithrilDlDedup";
1919
/// Parallel Download Processor Worker.
2020
pub(crate) const PARALLEL_DL_WORKER: &str = "ParallelDlWorker";
21-
/// Parallel Download Processor Get Content Length.
22-
pub(crate) const PARALLEL_DL_GET_CONTENT_LENGTH: &str = "ParallelDlGetContentLength";

rust/cardano-chain-follower/src/turbo_downloader/mod.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl ParallelDownloadProcessor {
375375
MIN_CHUNK_SIZE
376376
);
377377
}
378-
let file_size = get_content_length_async(url, chain).await?;
378+
let file_size = get_content_length_async(url).await?;
379379

380380
// Get the minimum number of workers we need, just in case the chunk size is bigger than
381381
// the requested workers can process.
@@ -701,20 +701,9 @@ impl std::io::Read for ParallelDownloadProcessor {
701701
///
702702
/// This exists because the `Probe` call made by Mithril is Async, and this makes
703703
/// interfacing to that easier.
704-
async fn get_content_length_async(url: &str, chain: Network) -> anyhow::Result<usize> {
704+
async fn get_content_length_async(url: &str) -> anyhow::Result<usize> {
705705
let url = url.to_owned();
706-
match tokio::task::spawn_blocking(move || {
707-
stats::start_thread(
708-
chain,
709-
stats::thread::name::PARALLEL_DL_GET_CONTENT_LENGTH,
710-
false,
711-
);
712-
let result = get_content_length(&url);
713-
stats::stop_thread(chain, stats::thread::name::PARALLEL_DL_GET_CONTENT_LENGTH);
714-
result
715-
})
716-
.await
717-
{
706+
match tokio::task::spawn_blocking(move || get_content_length(&url)).await {
718707
Ok(result) => result,
719708
Err(error) => {
720709
error!("get_content_length failed");

0 commit comments

Comments
 (0)