Skip to content

Commit

Permalink
improve readablility
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Feb 17, 2023
1 parent e6865f0 commit 2f850d1
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions crates/turbo-tasks/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,23 +427,14 @@ impl<B: Backend> TurboTasks<B> {
}

// Setup thread locals
if let Some((result, duration, instant)) = CELL_COUNTERS
.scope(Default::default(), async {
if let Some(execution) =
this.backend.try_start_task_execution(task_id, &*this)
{
Some(
TimedFuture::new(
AssertUnwindSafe(execution.future).catch_unwind(),
)
.await,
)
} else {
None
}
})
.await
{
let execution_future = CELL_COUNTERS.scope(Default::default(), async {
let execution = this.backend.try_start_task_execution(task_id, &*this)?;
Some(
TimedFuture::new(AssertUnwindSafe(execution.future).catch_unwind())
.await,
)
});
if let Some((result, duration, instant)) = execution_future.await {
if cfg!(feature = "log_function_stats") && duration.as_millis() > 1000 {
println!(
"{} took {}",
Expand Down

0 comments on commit 2f850d1

Please sign in to comment.