Skip to content

Commit

Permalink
break when no events is returned anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Sep 1, 2024
1 parent f62acf2 commit 24bfd4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/dojo-world/src/manifest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,18 @@ async fn get_events<P: Provider + Send + Sync>(
loop {
let res =
provider.get_events(filter.clone(), continuation_token, DEFAULT_CHUNK_SIZE).await?;

continuation_token = res.continuation_token;
events.extend(res.events);

if continuation_token.is_none() {
break;
}

// stop when there are no more events being returned
if res.events.is_empty() {
break;
} else {
events.extend(res.events);
}
}

Ok(events)
Expand Down

0 comments on commit 24bfd4b

Please sign in to comment.