Skip to content

Commit bd0f7c3

Browse files
committed
Cleanup from review feedback
1 parent b89a4e3 commit bd0f7c3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

crates/services/block_aggregator_api/src/blocks/importer_and_db_source/sync_service.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ where
9999
}
100100
Ok(txs)
101101
}
102+
103+
// For now just have arbitrary 10 ms sleep to avoid busy looping.
104+
// This could be more complicated with increasing backoff times, etc.
105+
async fn go_to_sleep_before_continuing(&self) {
106+
tokio::time::sleep(Duration::from_millis(10)).await;
107+
}
102108
}
103109

104110
impl<Serializer, DB, E> RunnableTask for SyncTask<Serializer, DB>
@@ -135,7 +141,7 @@ where
135141
self.next_height = BlockHeight::from((*next_height).saturating_add(1));
136142
} else {
137143
tracing::warn!("no block found at height {:?}, retrying", next_height);
138-
tokio::time::sleep(Duration::from_millis(10)).await;
144+
self.go_to_sleep_before_continuing().await;
139145
}
140146
TaskNextAction::Continue
141147
}

crates/services/importer/src/importer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,6 @@ where
520520
}
521521
}
522522
}
523-
let a = 100;
524-
let _ = a;
525523
}
526524

527525
/// Prepares the block for committing. It includes the execution of the block,

0 commit comments

Comments
 (0)