Extend debug mode in cron step to accept list of kuerzel (SB, AI, RO)
This commit is contained in:
@@ -37,4 +37,5 @@ class Config:
|
||||
|
||||
# Calendar Sync settings
|
||||
CALENDAR_SYNC_ANONYMIZE_GOOGLE_EVENTS = os.getenv('CALENDAR_SYNC_ANONYMIZE_GOOGLE_EVENTS', 'true').lower() == 'true'
|
||||
CALENDAR_SYNC_DEBUG_KUERZEL = [k.strip().upper() for k in os.getenv('CALENDAR_SYNC_DEBUG_KUERZEL', 'SB,AI,RO').split(',')]
|
||||
ADVOWARE_WRITE_PROTECTION = True
|
||||
@@ -8,8 +8,8 @@ CALENDAR_SYNC_LOCK_KEY = 'calendar_sync_lock'
|
||||
config = {
|
||||
'type': 'cron',
|
||||
'name': 'Calendar Sync Cron Job',
|
||||
'description': 'Führt den Calendar Sync alle 15 Minuten automatisch aus',
|
||||
'cron': '*/15 * * * *', # Alle 15 Minuten
|
||||
'description': 'Führt den Calendar Sync alle 5 Minuten automatisch aus',
|
||||
'cron': '*/5 * * * *', # Alle 5 Minuten
|
||||
'emits': ['calendar_sync_employee'],
|
||||
'flows': ['advoware']
|
||||
}
|
||||
@@ -45,9 +45,9 @@ async def handler(context):
|
||||
context.logger.warning(f"Mitarbeiter ohne Kürzel übersprungen: {employee}")
|
||||
continue
|
||||
|
||||
# DEBUG: Nur für Nutzer SB syncen
|
||||
if kuerzel != 'SB':
|
||||
context.logger.info(f"DEBUG: Überspringe {kuerzel}, nur SB wird gesynct")
|
||||
# DEBUG: Nur für konfigurierte Nutzer syncen
|
||||
if kuerzel not in Config.CALENDAR_SYNC_DEBUG_KUERZEL:
|
||||
context.logger.info(f"DEBUG: Überspringe {kuerzel}, nur {Config.CALENDAR_SYNC_DEBUG_KUERZEL} werden gesynct")
|
||||
continue
|
||||
|
||||
employee_lock_key = f'calendar_sync_lock_{kuerzel}'
|
||||
|
||||
Reference in New Issue
Block a user