Refactor calendar sync to prioritize oldest synced employees with human-readable timestamps

This commit is contained in:
root
2025-10-26 08:58:48 +00:00
parent b18e770f12
commit 96eabe3db6
4 changed files with 59 additions and 26 deletions

View File

@@ -6,8 +6,8 @@ from services.advoware import AdvowareAPI
config = {
'type': 'cron',
'name': 'Calendar Sync Cron Job',
'description': 'Führt den Calendar Sync alle 5 Minuten automatisch aus',
'cron': '*/5 * * * *', # Alle 5 Minuten
'description': 'Führt den Calendar Sync alle 1 Minuten automatisch aus',
'cron': '*/1 * * * *', # Alle 1 Minute
'emits': ['calendar_sync_all'],
'flows': ['advoware']
}
@@ -17,12 +17,12 @@ async def handler(context):
context.logger.info("Calendar Sync Cron: Starting to emit sync-all event")
# # Emit sync-all event
# await context.emit({
# "topic": "calendar_sync_all",
# "data": {
# "triggered_by": "cron"
# }
# })
await context.emit({
"topic": "calendar_sync_all",
"data": {
"triggered_by": "cron"
}
})
context.logger.info("Calendar Sync Cron: Emitted sync-all event")
return {