Skip to content

Commit

Permalink
fix: attempt again to fix rpc-downloader shutdown (#1766)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19-cw authored Oct 14, 2024
1 parent a7d9837 commit c7cb308
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/bin/rpc_downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ async fn download_blocks(rpc_storage: Arc<dyn ExternalRpcStorage>, chain: Arc<Bl

let mut stream = stream::iter(tasks).buffered(paralellism);
while let Some(result) = stream.next().await {
if let Err(e) = result {
tracing::error!(reason = ?e, "download task failed");
}

if GlobalState::is_shutdown_warn(TASK_NAME) {
break;
}

if let Err(e) = result {
tracing::error!(reason = ?e, "download task failed");
}
}

tracing::info!("download finished");
Expand All @@ -144,7 +144,7 @@ async fn download(
while current <= end_inclusive {
loop {
if GlobalState::is_shutdown_warn(TASK_NAME) {
break;
return Ok(());
}

// retrieve block
Expand Down

0 comments on commit c7cb308

Please sign in to comment.