From 25429edd76ee5873ddcd5d16b9287088c45aed69 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Oct 2025 01:08:09 +0000 Subject: [PATCH] Extend debug mode in cron step to accept list of kuerzel (SB, AI, RO) --- bitbylaw/config.py | 1 + .../steps/advoware_cal_sync/calendar_sync_cron_step.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bitbylaw/config.py b/bitbylaw/config.py index ab2ae933..e45e77a2 100644 --- a/bitbylaw/config.py +++ b/bitbylaw/config.py @@ -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 \ No newline at end of file diff --git a/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py b/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py index 7e1f518e..e97ad114 100644 --- a/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py +++ b/bitbylaw/steps/advoware_cal_sync/calendar_sync_cron_step.py @@ -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}'