fix: handle unsupported document types in RAGflow sync and improve logging
This commit is contained in:
@@ -684,11 +684,17 @@ async def _run_ragflow_sync(
|
|||||||
ctx.logger.info(
|
ctx.logger.info(
|
||||||
f" ⏭️ Nicht unterstützter Dateityp ({mime_type}) – übersprungen"
|
f" ⏭️ Nicht unterstützter Dateityp ({mime_type}) – übersprungen"
|
||||||
)
|
)
|
||||||
if not ragflow_doc_id:
|
# If doc was previously uploaded to RAGflow (e.g. type changed), remove it
|
||||||
await espocrm.update_entity('CDokumente', doc_id, {
|
if ragflow_doc_id:
|
||||||
'aiSyncStatus': 'unsupported',
|
try:
|
||||||
'aiLastSync': datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
await ragflow.remove_document(dataset_id, ragflow_doc_id)
|
||||||
})
|
ctx.logger.info(f" 🗑️ Aus RAGflow entfernt (nicht unterstützt): {ragflow_doc_id}")
|
||||||
|
except Exception as e:
|
||||||
|
ctx.logger.warn(f" ⚠️ RAGflow-Löschung fehlgeschlagen: {e}")
|
||||||
|
await espocrm.update_entity('CDokumente', doc_id, {
|
||||||
|
'aiSyncStatus': 'unsupported',
|
||||||
|
'aiLastSync': datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
||||||
|
})
|
||||||
skipped += 1
|
skipped += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user