refactor(logging): remove unused logger instances and enhance error logging in webhook steps
This commit is contained in:
@@ -20,6 +20,12 @@ MAX_SYNC_RETRIES = 5
|
||||
# Retry backoff: Wartezeit zwischen Retries (in Minuten)
|
||||
RETRY_BACKOFF_MINUTES = [1, 5, 15, 60, 240] # 1min, 5min, 15min, 1h, 4h
|
||||
|
||||
# Legacy file status values (for backward compatibility)
|
||||
# These are old German and English status values that may still exist in the database
|
||||
LEGACY_NEW_STATUS_VALUES = {'neu', 'Neu', 'New'}
|
||||
LEGACY_CHANGED_STATUS_VALUES = {'geändert', 'Geändert', 'Changed'}
|
||||
LEGACY_SYNCED_STATUS_VALUES = {'synced', 'Synced', 'synchronized', 'Synchronized'}
|
||||
|
||||
|
||||
class DocumentSync(BaseSyncUtils):
|
||||
"""Utility class for document synchronization with xAI"""
|
||||
@@ -185,16 +191,11 @@ class DocumentSync(BaseSyncUtils):
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
# PRIORITY CHECK 2: fileStatus "new" or "changed"
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
if datei_status in [
|
||||
FileStatus.NEW.value,
|
||||
FileStatus.CHANGED.value,
|
||||
'neu', # Legacy German values
|
||||
'geändert', # Legacy German values
|
||||
'Neu', # Case variations
|
||||
'Geändert',
|
||||
'New',
|
||||
'Changed'
|
||||
]:
|
||||
# Check for standard enum values and legacy values
|
||||
is_new = (datei_status == FileStatus.NEW.value or datei_status in LEGACY_NEW_STATUS_VALUES)
|
||||
is_changed = (datei_status == FileStatus.CHANGED.value or datei_status in LEGACY_CHANGED_STATUS_VALUES)
|
||||
|
||||
if is_new or is_changed:
|
||||
self._log(f"🆕 fileStatus: '{datei_status}' → xAI sync REQUIRED")
|
||||
|
||||
if target_collections:
|
||||
|
||||
Reference in New Issue
Block a user