Skip to content

Commit

Permalink
Merge pull request #4205 from systeminit/brit/bug-467-fix-import_pkg
Browse files Browse the repository at this point in the history
fix(dal): Don't keep looping through past hashes if you find an existing schema when importing a pkg
  • Loading branch information
britmyerss authored Jul 23, 2024
2 parents f674e4c + dca5f89 commit 3cbfb70
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/dal/src/pkg/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,17 @@ async fn import_schema(
// find if there's an existing module
// if there is, find the asssociated schemas
if let Some(found) = Module::find_by_root_hash(ctx, past_hash).await? {
existing_schema =
found.list_associated_schemas(ctx).await?.into_iter().next();
match found.list_associated_schemas(ctx).await?.into_iter().next() {
Some(existing) => {
existing_schema = Some(existing);
break;
}
None => continue,
}
}
}
}
}

let data = schema_spec
.data()
.ok_or(PkgError::DataNotFound("schema".into()))?;
Expand Down

0 comments on commit 3cbfb70

Please sign in to comment.