fixed teams
This commit is contained in:
parent
48c0f900af
commit
c130f49cf9
2 changed files with 14 additions and 3 deletions
|
|
@ -36,6 +36,16 @@ def _buildConnectionInventory(connections, rootIf, knowledgeIf, jobService) -> L
|
||||||
connIndexRows = knowledgeIf.db.getRecordset(FileContentIndex, recordFilter={"connectionId": connectionId})
|
connIndexRows = knowledgeIf.db.getRecordset(FileContentIndex, recordFilter={"connectionId": connectionId})
|
||||||
connChunkTotal = len(connIndexRows)
|
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 = []
|
dsItems = []
|
||||||
for ds in dataSources:
|
for ds in dataSources:
|
||||||
dsId = ds.get("id") if isinstance(ds, dict) else getattr(ds, "id", "")
|
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),
|
"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),
|
"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),
|
"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:
|
if unassigned > 0 and len(dsItems) == 1:
|
||||||
dsItems[0]["chunkCount"] = connChunkTotal
|
dsItems[0]["chunkCount"] += unassigned
|
||||||
|
|
||||||
jobs = jobService.listJobs(jobType="connection.bootstrap", limit=5)
|
jobs = jobService.listJobs(jobType="connection.bootstrap", limit=5)
|
||||||
connJobs = [j for j in jobs if (j.get("payload") or {}).get("connectionId") == connectionId]
|
connJobs = [j for j in jobs if (j.get("payload") or {}).get("connectionId") == connectionId]
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ class ExtractionService:
|
||||||
self._interfaceDbComponent = getComponentInterface(
|
self._interfaceDbComponent = getComponentInterface(
|
||||||
context.user,
|
context.user,
|
||||||
mandateId=context.mandate_id,
|
mandateId=context.mandate_id,
|
||||||
|
featureInstanceId=context.feature_instance_id,
|
||||||
)
|
)
|
||||||
self._extractorRegistry = getExtractorRegistry()
|
self._extractorRegistry = getExtractorRegistry()
|
||||||
if ExtractionService._sharedChunkerRegistry is None:
|
if ExtractionService._sharedChunkerRegistry is None:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue