Skip to content

Commit

Permalink
[Turbopack] fix effects tracing (#72928)
Browse files Browse the repository at this point in the history
### What?

small follow-up to fix the tracing of Effects::apply
  • Loading branch information
sokra authored Nov 19, 2024
1 parent fe5ef9b commit 0714c45
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions turbopack/crates/turbo-tasks/src/effect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,16 @@ impl Eq for Effects {}
impl Effects {
/// Applies all effects that have been captured by this struct.
pub async fn apply(&self) -> Result<()> {
let _span = tracing::info_span!("apply effects", count = self.effects.len());
let mut first_error = anyhow::Ok(());
for effect in self.effects.iter() {
apply_effect(effect, &mut first_error).await;
let span = tracing::info_span!("apply effects", count = self.effects.len());
async move {
let mut first_error = anyhow::Ok(());
for effect in self.effects.iter() {
apply_effect(effect, &mut first_error).await;
}
first_error
}
first_error
.instrument(span)
.await
}
}

Expand Down

0 comments on commit 0714c45

Please # to comment.