fix: Update collection ID retrieval logic and simplify error logging in AI Knowledge sync event handler

This commit is contained in:
bsiggel
2026-03-12 23:04:01 +00:00
parent 9a3e01d447
commit 9ada48d8c8
2 changed files with 3 additions and 2 deletions

View File

@@ -144,7 +144,8 @@ class AIKnowledgeSync(BaseSyncUtils):
} }
) )
collection_id = collection['id'] # XAI API returns 'collection_id' not 'id'
collection_id = collection.get('collection_id') or collection.get('id')
# Update EspoCRM: Set datenbankId + change status to 'active' # Update EspoCRM: Set datenbankId + change status to 'active'
await espocrm.update_entity('CAIKnowledge', knowledge_id, { await espocrm.update_entity('CAIKnowledge', knowledge_id, {

View File

@@ -74,7 +74,7 @@ async def handler(event_data: Dict[str, Any], ctx: FlowContext[Any]) -> None:
ctx.logger.error("=" * 80) ctx.logger.error("=" * 80)
ctx.logger.error("❌ AI KNOWLEDGE SYNC FAILED") ctx.logger.error("❌ AI KNOWLEDGE SYNC FAILED")
ctx.logger.error("=" * 80) ctx.logger.error("=" * 80)
ctx.logger.error(f"Error: {e}", exc_info=True) ctx.logger.error(f"Error: {e}")
ctx.logger.error(f"Knowledge ID: {knowledge_id}") ctx.logger.error(f"Knowledge ID: {knowledge_id}")
ctx.logger.error("=" * 80) ctx.logger.error("=" * 80)