Skip to content

Commit

Permalink
indexer: remove unused spawn_blocking method from IndexerReader
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Sep 6, 2024
1 parent 1edcf13 commit f811a09
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions crates/sui-indexer/src/indexer_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down Expand Up @@ -98,24 +97,6 @@ impl IndexerReader {
})
}

pub async fn spawn_blocking<F, R, E>(&self, f: F) -> Result<R, E>
where
F: FnOnce(Self) -> Result<R, E> + 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
}
Expand Down

0 comments on commit f811a09

Please sign in to comment.