Fix Git source sync failures
This commit is contained in:
+18
-9
@@ -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")])
|
||||
|
||||
Reference in New Issue
Block a user