Skip to content

Commit

Permalink
fix: downloader shutdown leads to verification failure
Browse files Browse the repository at this point in the history
  • Loading branch information
de-sh committed Apr 4, 2024
1 parent 2e984f4 commit 8192348
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions uplink/src/collector/downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,19 @@ impl FileDownloader {
}
};
select! {
// NOTE: if download has timedout don't do anything, else ensure errors are forwarded after three retries
o = timeout_at(deadline, self.continuous_retry(state)) => match o {
Ok(r) => r?,
Err(_) => error!("Last download has timedout"),
},

_ = shutdown_rx.recv_async() => {
if let Err(e) = state.save(&self.config) {
error!("Error saving current_download: {e}");
}
}

return Ok(());
},

// NOTE: if download has timedout don't do anything, else ensure errors are forwarded after three retries
o = timeout_at(deadline, self.continuous_retry(state)) => match o {
Ok(r) => r?,
Err(_) => error!("Last download has timedout"),
}
}

state.current.meta.verify_checksum()?;
Expand Down

0 comments on commit 8192348

Please sign in to comment.