Skip to content

Commit

Permalink
Merge pull request #4796 from opsmill/pog-avoid-schema-load-api
Browse files Browse the repository at this point in the history
Avoid useless call to schema load api on repo import
  • Loading branch information
dgarros authored Oct 31, 2024
2 parents 5a80d78 + db6aba2 commit e365942
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/infrahub/git/integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,11 @@ async def import_schema_files(self, branch_name: str, commit: str, config_file:
schema_file.load_content()
schemas_data.append(schema_file)

if not schemas_data:
# If the repository doesn't contain any schema files there is no reason to continue
# and send an empty list to the API
return

for schema_file in schemas_data:
if schema_file.valid:
continue
Expand Down
1 change: 1 addition & 0 deletions changelog/+9b1d29f3.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Avoid sending an empty list to the load schema API on repository import if it's not required

0 comments on commit e365942

Please sign in to comment.