Add calendar sync step files: API, cron, and event handlers for bidirectional Advoware-Google Calendar sync

This commit is contained in:
root
2025-10-22 23:37:28 +00:00
parent 0a4317c44a
commit 2f9203cac2
3 changed files with 770 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import json
config = {
'type': 'cron',
'name': 'Calendar Sync Cron Job',
'description': 'Führt den Calendar Sync alle 15 Minuten automatisch aus',
'cron': '*/15 * * * *', # Alle 15 Minuten
'emits': ['calendar.sync.triggered']
}
async def handler(event, context):
try:
context.logger.info("Calendar Sync Cron: Starte automatische Synchronisation alle 15 Minuten")
# Emit Event für den Sync
await context.emit({
"topic": "calendar.sync.triggered",
"data": {
"body": {
"full_content": True, # Cron verwendet immer volle Details
"triggered_by": "cron"
}
}
})
context.logger.info("Calendar Sync Cron: Event wurde emittiert")
return {
'status': 'completed',
'triggered_by': 'cron'
}
except Exception as e:
context.logger.error(f"Fehler beim Cron-Job: {e}")
return {
'status': 'error',
'error': str(e)
}