Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarTawfik committed Dec 4, 2023
1 parent 41474e0 commit b7161a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ solidity_testing_utils = { path = "crates/solidity/testing/utils" }
#
# External
#
anyhow = { version = "1.0.70", features = ["backtrace", "std"] }
anyhow = { version = "1.0.75", features = ["backtrace", "std"] }
ariadne = { version = "0.2.0" }
bson = { version = "2.6.1" }
cargo-emit = { version = "0.2.1" }
Expand Down
7 changes: 4 additions & 3 deletions crates/solidity/testing/solc/src/utils/binaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ fn fetch_releases(mirror_url: &Url, binaries_dir: &Path) -> Result<HashMap<Versi

let list_path = binaries_dir.join("list.json");

let download_fresh_list = match list_path.metadata() {
Err(_) => true,
let should_download_list = match list_path.metadata() {
Err(err) if err.kind() == std::io::ErrorKind::NotFound => true,
Err(err) => return Err(err)?,
Ok(metadata) => metadata.created()?.elapsed()? > Duration::from_secs(60 * 60 * 24),
};

if download_fresh_list {
if should_download_list {
let list_url = mirror_url.join("list.json")?;
download_file(list_url, &list_path)?;
}
Expand Down

0 comments on commit b7161a5

Please sign in to comment.