feat(ragflow): Add MIME type filter to skip unsupported file uploads
This commit is contained in:
@@ -636,6 +636,20 @@ async def _run_ragflow_sync(
|
||||
if not mime_type:
|
||||
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:
|
||||
if ragflow_doc_id and not content_changed and meta_changed:
|
||||
# ── Nur Metadaten aktualisieren ───────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user