feat(ragflow): Add MIME type filter to skip unsupported file uploads

This commit is contained in:
bsiggel
2026-03-31 06:01:10 +00:00
parent b6a0bd8d80
commit a5ca63ea52

View File

@@ -636,6 +636,20 @@ async def _run_ragflow_sync(
if not mime_type: if not mime_type:
mime_type = 'application/octet-stream' mime_type = 'application/octet-stream'
# ── Dateityp-Filter: nur unterstützte MIME-Typen hochladen ──────────
is_eml = filename.lower().endswith('.eml') or mime_type == 'message/rfc822'
if not is_eml and mime_type not in RAGFlowService.SUPPORTED_MIME_TYPES:
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'),
})
skipped += 1
continue
try: try:
if ragflow_doc_id and not content_changed and meta_changed: if ragflow_doc_id and not content_changed and meta_changed:
# ── Nur Metadaten aktualisieren ─────────────────────────── # ── Nur Metadaten aktualisieren ───────────────────────────