Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break on empty events when loading from remote #2376

Merged
merged 2 commits into from
Sep 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,9 +551,14 @@
loop {
let res =
provider.get_events(filter.clone(), continuation_token, DEFAULT_CHUNK_SIZE).await?;

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

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

Check warning on line 558 in crates/dojo-world/src/manifest/mod.rs

View check run for this annotation

Codecov / codecov/patch

crates/dojo-world/src/manifest/mod.rs#L558

Added line #L558 was not covered by tests
} else {
events.extend(res.events);
}

if continuation_token.is_none() {
break;
Expand Down
Loading