Skip to content

Commit

Permalink
Show fetch time for advisory databases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Jan 21, 2024
1 parent 19e301e commit 74f746b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/advisories/helpers/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ fn load_db(url: Url, root_db_path: PathBuf, fetch: Fetch) -> anyhow::Result<Advi
let db_url = &url;
let db_path = url_to_db_path(root_db_path, db_url)?;

let fetch_start = std::time::Instant::now();
match fetch {
Fetch::Allow => {
debug!("Fetching advisory database from '{db_url}'");
Expand Down Expand Up @@ -165,6 +166,11 @@ fn load_db(url: Url, root_db_path: PathBuf, fetch: Fetch) -> anyhow::Result<Advi
.context("unable to compute oldest allowable update timestamp")?,
"repository is stale (last update: {fetch_time})"
);
} else {
info!(
"advisory database {db_url} fetched in {:?}",
fetch_start.elapsed()
);
}

debug!("loading advisory database from {db_path}");
Expand Down

0 comments on commit 74f746b

Please sign in to comment.