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 settings
|
||||||
CALENDAR_SYNC_ANONYMIZE_GOOGLE_EVENTS = os.getenv('CALENDAR_SYNC_ANONYMIZE_GOOGLE_EVENTS', 'true').lower() == 'true'
|
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
|
ADVOWARE_WRITE_PROTECTION = True
|
||||||
@@ -8,8 +8,8 @@ CALENDAR_SYNC_LOCK_KEY = 'calendar_sync_lock'
|
|||||||
config = {
|
config = {
|
||||||
'type': 'cron',
|
'type': 'cron',
|
||||||
'name': 'Calendar Sync Cron Job',
|
'name': 'Calendar Sync Cron Job',
|
||||||
'description': 'Führt den Calendar Sync alle 15 Minuten automatisch aus',
|
'description': 'Führt den Calendar Sync alle 5 Minuten automatisch aus',
|
||||||
'cron': '*/15 * * * *', # Alle 15 Minuten
|
'cron': '*/5 * * * *', # Alle 5 Minuten
|
||||||
'emits': ['calendar_sync_employee'],
|
'emits': ['calendar_sync_employee'],
|
||||||
'flows': ['advoware']
|
'flows': ['advoware']
|
||||||
}
|
}
|
||||||
@@ -45,9 +45,9 @@ async def handler(context):
|
|||||||
context.logger.warning(f"Mitarbeiter ohne Kürzel übersprungen: {employee}")
|
context.logger.warning(f"Mitarbeiter ohne Kürzel übersprungen: {employee}")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# DEBUG: Nur für Nutzer SB syncen
|
# DEBUG: Nur für konfigurierte Nutzer syncen
|
||||||
if kuerzel != 'SB':
|
if kuerzel not in Config.CALENDAR_SYNC_DEBUG_KUERZEL:
|
||||||
context.logger.info(f"DEBUG: Überspringe {kuerzel}, nur SB wird gesynct")
|
context.logger.info(f"DEBUG: Überspringe {kuerzel}, nur {Config.CALENDAR_SYNC_DEBUG_KUERZEL} werden gesynct")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
employee_lock_key = f'calendar_sync_lock_{kuerzel}'
|
employee_lock_key = f'calendar_sync_lock_{kuerzel}'
|
||||||
|
|||||||
Reference in New Issue
Block a user