Skip to content

Commit

Permalink
controllers/krate/metadata: Pipelining database queries (#10326)
Browse files Browse the repository at this point in the history
  • Loading branch information
eth3lbert authored Jan 6, 2025
1 parent 6227956 commit 5107aaf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/controllers/krate/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ pub async fn find_crate(
.filter(|_| include.default_version && !include.versions)
{
let version = krate.find_version(&mut conn, default_version).await?;
let published_by = version.published_by(&mut conn).await?;
let actions = VersionOwnerAction::by_version(&mut conn, &version).await?;
let (actions, published_by) = tokio::try_join!(
VersionOwnerAction::by_version(&mut conn, &version),
version.published_by(&mut conn),
)?;
versions_publishers_and_audit_actions = Some(vec![(version, published_by, actions)]);
};

Expand Down

0 comments on commit 5107aaf

Please sign in to comment.