diff --git a/crates/crates_io_worker/src/util.rs b/crates/crates_io_worker/src/util.rs index b960b1fbc8f..b001bb49219 100644 --- a/crates/crates_io_worker/src/util.rs +++ b/crates/crates_io_worker/src/util.rs @@ -1,5 +1,5 @@ use anyhow::anyhow; -use sentry_core::Hub; +use sentry_core::{Hub, SentryFutureExt}; use std::any::Any; use std::future::Future; use std::panic::PanicHookInfo; @@ -20,7 +20,7 @@ where hub.configure_scope(|scope| scope.set_span(Some(tx.clone().into()))); - let result = callback().await; + let result = callback().bind_hub(hub).await; tx.set_status(match result.is_ok() { true => sentry_core::protocol::SpanStatus::Ok, diff --git a/crates/crates_io_worker/src/worker.rs b/crates/crates_io_worker/src/worker.rs index 5f5c1fdd696..52f1d61ee50 100644 --- a/crates/crates_io_worker/src/worker.rs +++ b/crates/crates_io_worker/src/worker.rs @@ -7,7 +7,6 @@ use diesel_async::pooled_connection::deadpool::Pool; use diesel_async::scoped_futures::ScopedFutureExt; use diesel_async::{AsyncConnection, AsyncPgConnection}; use futures_util::FutureExt; -use sentry_core::{Hub, SentryFutureExt}; use std::panic::AssertUnwindSafe; use std::sync::Arc; use std::time::Duration; @@ -87,10 +86,7 @@ impl Worker { .and_then(std::convert::identity) }); - let result = future - .instrument(span.clone()) - .bind_hub(Hub::current()) - .await; + let result = future.instrument(span.clone()).await; let _enter = span.enter(); match result {