Skip to content

Commit

Permalink
Reapply "feat: add more debug info"
Browse files Browse the repository at this point in the history
This reverts commit a6c270d.
  • Loading branch information
eatradish committed May 28, 2024
1 parent 27ecf68 commit ae68588
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions buildit-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::github::{find_version_by_packages, print_stdout_and_stderr, update_abbs};
use abbs_update_checksum_core::get_new_spec;
use anyhow::{anyhow, bail, Context};
use anyhow::{bail, Context};
use github::get_spec;
use once_cell::sync::Lazy;
use std::{
Expand Down Expand Up @@ -168,15 +168,19 @@ async fn write_new_spec(abbs_path_shared: PathBuf, pkg_shared: String) -> anyhow
let (mut spec, p) = spawn_blocking(move || get_spec(&abbs_path_shared, &pkg_shared)).await??;

for i in 1..=5 {
match get_new_spec(&mut spec).await.map_err(|e| anyhow!("{e}")) {
match get_new_spec(&mut spec).await {
Ok(()) => {
if i > 1 {
info!("({i}/5) Retrying to get new spec...");
}

fs::write(p, spec).await?;
return Ok(());
}
Err(e) => {
error!("Failed to get new spec: {e}");
if i == 5 {
return Err(e);
bail!("{e}");
}
}
}
Expand Down

0 comments on commit ae68588

Please sign in to comment.