Skip to content

Commit

Permalink
clone shutdown tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Sep 25, 2024
1 parent c13ff59 commit 7fc27d5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions crates/torii/core/src/sql_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ async fn test_load_from_remote(sequencer: &RunnerCtx) {
let world_reader = WorldContractReader::new(strat.world_address, Arc::clone(&provider));

let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down Expand Up @@ -302,7 +302,7 @@ async fn test_load_from_remote_del(sequencer: &RunnerCtx) {
let world_reader = WorldContractReader::new(strat.world_address, Arc::clone(&provider));

let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down Expand Up @@ -393,7 +393,7 @@ async fn test_update_with_set_record(sequencer: &RunnerCtx) {
let world_reader = WorldContractReader::new(strat.world_address, Arc::clone(&provider));

let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down
2 changes: 1 addition & 1 deletion crates/torii/graphql/src/tests/metadata_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mod tests {
#[sqlx::test(migrations = "../migrations")]
async fn test_metadata(pool: SqlitePool) {
let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down
2 changes: 1 addition & 1 deletion crates/torii/graphql/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ pub async fn spinup_types_test() -> Result<SqlitePool> {
let world = WorldContractReader::new(strat.world_address, Arc::clone(&provider));

let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down
10 changes: 5 additions & 5 deletions crates/torii/graphql/src/tests/subscription_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mod tests {
#[serial]
async fn test_entity_subscription(pool: SqlitePool) {
let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down Expand Up @@ -163,7 +163,7 @@ mod tests {
#[serial]
async fn test_entity_subscription_with_id(pool: SqlitePool) {
let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down Expand Up @@ -283,7 +283,7 @@ mod tests {
#[serial]
async fn test_model_subscription(pool: SqlitePool) {
let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down Expand Up @@ -353,7 +353,7 @@ mod tests {
#[serial]
async fn test_model_subscription_with_id(pool: SqlitePool) {
let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down Expand Up @@ -424,7 +424,7 @@ mod tests {
#[serial]
async fn test_event_emitted(pool: SqlitePool) {
let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down
2 changes: 1 addition & 1 deletion crates/torii/grpc/src/server/tests/entities_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async fn test_entities_queries(sequencer: &RunnerCtx) {
TransactionWaiter::new(tx.transaction_hash, &provider).await.unwrap();

let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down
2 changes: 1 addition & 1 deletion crates/torii/libp2p/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ mod test {
let account = sequencer.account_data(0);

let (shutdown_tx, _) = broadcast::channel(1);
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx).await.unwrap();
let (mut executor, sender) = Executor::new(pool.clone(), shutdown_tx.clone()).await.unwrap();
tokio::spawn(async move {
executor.run().await.unwrap();
});
Expand Down

0 comments on commit 7fc27d5

Please sign in to comment.