Fix Git source sync failures

This commit is contained in:
george
2026-06-06 00:48:21 +01:00
parent 54986cda99
commit fc683b2803
4 changed files with 111 additions and 38 deletions
+18 -9
View File
@@ -432,15 +432,24 @@ async def sync_sources_api(payload: Optional[SyncSourcesRequest] = None):
results = []
for source in sources:
result = await ingest_git_source(
library_id=source["library_id"],
name=source.get("name") or source["library_id"],
description=source.get("description"),
repo_url=source["repo_url"],
branch=source.get("branch", "main"),
include_paths=source.get("include_paths"),
exclude_paths=source.get("exclude_paths"),
)
library_id = source.get("library_id", "unknown")
try:
result = await ingest_git_source(
library_id=library_id,
name=source.get("name") or library_id,
description=source.get("description"),
repo_url=source["repo_url"],
branch=source.get("branch", "main"),
include_paths=source.get("include_paths"),
exclude_paths=source.get("exclude_paths"),
)
except Exception as exc:
result = {
"success": False,
"library_id": library_id,
"repo_url": source.get("repo_url"),
"error": str(exc),
}
results.append(result)
successful = len([r for r in results if r.get("success")])