Skip to content

Commit 94c2189

Browse files
author
Devdutt Shenoi
committed
stream through results
1 parent 4af43a5 commit 94c2189

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/hottier.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,17 +236,14 @@ impl HotTierManager {
236236

237237
///sync the hot tier files from S3 to the hot tier directory for all streams
238238
async fn sync_hot_tier(&self) -> Result<(), HotTierError> {
239-
let streams = STREAM_INFO.list_streams();
240-
let sync_hot_tier_tasks = FuturesUnordered::new();
241-
for stream in streams {
239+
let mut sync_hot_tier_tasks = FuturesUnordered::new();
240+
for stream in STREAM_INFO.list_streams() {
242241
if self.check_stream_hot_tier_exists(&stream) {
243-
sync_hot_tier_tasks.push(async move { self.process_stream(stream).await });
244-
//self.process_stream(stream).await?;
242+
sync_hot_tier_tasks.push(self.process_stream(stream));
245243
}
246244
}
247245

248-
let res: Vec<_> = sync_hot_tier_tasks.collect().await;
249-
for res in res {
246+
while let Some(res) = sync_hot_tier_tasks.next().await {
250247
if let Err(err) = res {
251248
error!("Failed to run hot tier sync task {err:?}");
252249
return Err(err);

0 commit comments

Comments
 (0)