Debug: Rettet debug logging counter for kontakter

This commit is contained in:
Christian 2025-12-22 14:36:55 +01:00
parent 82ecfda404
commit 0b8a4ff5d0

View File

@ -202,6 +202,7 @@ async def sync_vtiger_contacts() -> Dict[str, Any]:
updated_count = 0
skipped_count = 0
linked_count = 0
debug_counter = 0 # Track how many we've logged
for contact in contacts:
vtiger_contact_id = contact.get('id')
@ -284,9 +285,10 @@ async def sync_vtiger_contacts() -> Dict[str, Any]:
# Link contact to customer if account_id exists
account_id = contact.get('account_id')
# Debug: Log first 10 contacts with account_id info
if len(contacts) < 20: # Only log for small batches or first few
logger.info(f"🔍 Debug kontakt: {first_name} {last_name}, account_id={account_id}, contact_id={contact_id if 'contact_id' in locals() else 'N/A'}")
# Debug: Log first 20 contacts with account_id info
if debug_counter < 20:
logger.info(f"🔍 Debug kontakt #{debug_counter+1}: {first_name} {last_name}, account_id='{account_id}', contact_id={contact_id if 'contact_id' in locals() else 'N/A'}")
debug_counter += 1
if account_id and contact_id:
# Find customer by vTiger account ID