File tree Expand file tree Collapse file tree 2 files changed +3
-16
lines changed
rust/cardano-chain-follower/src Expand file tree Collapse file tree 2 files changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -18,5 +18,3 @@ pub(crate) const VALIDATE_MITHRIL_SNAPSHOT: &str = "ValidateMithrilSnapshot";
1818pub ( crate ) const MITHRIL_DL_DEDUP : & str = "MithrilDlDedup" ;
1919/// Parallel Download Processor Worker.
2020pub ( 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" ;
Original file line number Diff line number Diff 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" ) ;
You can’t perform that action at this time.
0 commit comments