From f811a09a115ec86f2403834ad508d40ea573d3da Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Fri, 6 Sep 2024 13:53:34 -0500 Subject: [PATCH] indexer: remove unused spawn_blocking method from IndexerReader --- crates/sui-indexer/src/indexer_reader.rs | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/crates/sui-indexer/src/indexer_reader.rs b/crates/sui-indexer/src/indexer_reader.rs index 67d5d3295548e..5ef988e48ca60 100644 --- a/crates/sui-indexer/src/indexer_reader.rs +++ b/crates/sui-indexer/src/indexer_reader.rs @@ -40,7 +40,6 @@ use sui_types::{coin::CoinMetadata, event::EventID}; use crate::database::ConnectionPool; use crate::db::ConnectionPoolConfig; use crate::models::transactions::{stored_events_to_events, StoredTransactionEvents}; -use crate::store::diesel_macro::*; use crate::{ errors::IndexerError, models::{ @@ -98,24 +97,6 @@ impl IndexerReader { }) } - pub async fn spawn_blocking(&self, f: F) -> Result - where - F: FnOnce(Self) -> Result + Send + 'static, - R: Send + 'static, - E: Send + 'static, - { - let this = self.clone(); - let current_span = tracing::Span::current(); - tokio::task::spawn_blocking(move || { - CALLED_FROM_BLOCKING_POOL - .with(|in_blocking_pool| *in_blocking_pool.borrow_mut() = true); - let _guard = current_span.enter(); - f(this) - }) - .await - .expect("propagate any panics") - } - pub fn pool(&self) -> &ConnectionPool { &self.pool }