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(
|
||||
f" ⏭️ Nicht unterstützter Dateityp ({mime_type}) – übersprungen"
|
||||
)
|
||||
if not ragflow_doc_id:
|
||||
await espocrm.update_entity('CDokumente', doc_id, {
|
||||
'aiSyncStatus': 'unsupported',
|
||||
'aiLastSync': datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
|
||||
})
|
||||
# If doc was previously uploaded to RAGflow (e.g. type changed), remove it
|
||||
if ragflow_doc_id:
|
||||
try:
|
||||
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
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user