Skip to content

Commit

Permalink
fix: forward error messages triggering retry (#333)
Browse files Browse the repository at this point in the history
This is for observability
  • Loading branch information
de-sh authored Apr 1, 2024
1 parent 2f365e8 commit 155fbaa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion uplink/src/collector/downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,13 @@ impl FileDownloader {
loop {
match self.download(req, &mut download).await {
Ok(_) => break,
Err(Error::Reqwest(e)) if !e.is_status() => error!("Download failed: {e}"),
Err(Error::Reqwest(e)) if !e.is_status() => {
let status = ActionResponse::progress(&self.action_id, "Download Failed", 0)
.set_sequence(self.sequence())
.add_error(e.to_string());
self.bridge_tx.send_action_response(status).await;
error!("Download failed: {e}");
}
Err(e) => return Err(e),
}
tokio::time::sleep(Duration::from_secs(1)).await;
Expand Down

0 comments on commit 155fbaa

Please sign in to comment.