fixed teams

This commit is contained in:
ValueOn AG 2026-05-12 17:49:48 +02:00
parent 48c0f900af
commit c130f49cf9
2 changed files with 14 additions and 3 deletions

View file

@ -36,6 +36,16 @@ def _buildConnectionInventory(connections, rootIf, knowledgeIf, jobService) -> L
connIndexRows = knowledgeIf.db.getRecordset(FileContentIndex, recordFilter={"connectionId": connectionId})
connChunkTotal = len(connIndexRows)
chunksByDs: Dict[str, int] = {}
unassigned = 0
for idx in connIndexRows:
prov = (idx.get("provenance") if isinstance(idx, dict) else getattr(idx, "provenance", None)) or {}
dsIdRef = prov.get("dataSourceId", "") if isinstance(prov, dict) else ""
if dsIdRef:
chunksByDs[dsIdRef] = chunksByDs.get(dsIdRef, 0) + 1
else:
unassigned += 1
dsItems = []
for ds in dataSources:
dsId = ds.get("id") if isinstance(ds, dict) else getattr(ds, "id", "")
@ -47,11 +57,11 @@ def _buildConnectionInventory(connections, rootIf, knowledgeIf, jobService) -> L
"ragIndexEnabled": ds.get("ragIndexEnabled") if isinstance(ds, dict) else getattr(ds, "ragIndexEnabled", False),
"neutralize": ds.get("neutralize") if isinstance(ds, dict) else getattr(ds, "neutralize", False),
"lastIndexed": ds.get("lastIndexed") if isinstance(ds, dict) else getattr(ds, "lastIndexed", None),
"chunkCount": 0,
"chunkCount": chunksByDs.get(dsId, 0),
})
if dsItems and connChunkTotal > 0 and len(dsItems) == 1:
dsItems[0]["chunkCount"] = connChunkTotal
if unassigned > 0 and len(dsItems) == 1:
dsItems[0]["chunkCount"] += unassigned
jobs = jobService.listJobs(jobType="connection.bootstrap", limit=5)
connJobs = [j for j in jobs if (j.get("payload") or {}).get("connectionId") == connectionId]

View file

@ -33,6 +33,7 @@ class ExtractionService:
self._interfaceDbComponent = getComponentInterface(
context.user,
mandateId=context.mandate_id,
featureInstanceId=context.feature_instance_id,
)
self._extractorRegistry = getExtractorRegistry()
if ExtractionService._sharedChunkerRegistry is None: