cleanup
This commit is contained in:
@@ -2,19 +2,20 @@ import json
|
||||
import redis
|
||||
from config import Config
|
||||
from services.advoware import AdvowareAPI
|
||||
from .calendar_sync_utils import log_operation
|
||||
|
||||
config = {
|
||||
'type': 'cron',
|
||||
'name': 'Calendar Sync Cron Job',
|
||||
'description': 'Führt den Calendar Sync alle 1 Minuten automatisch aus',
|
||||
'cron': '*/1 * * * *', # Alle 1 Minute
|
||||
'cron': '0 0 31 2 *', # Nie ausführen (31. Februar)
|
||||
'emits': ['calendar_sync_all'],
|
||||
'flows': ['advoware']
|
||||
}
|
||||
|
||||
async def handler(context):
|
||||
try:
|
||||
context.logger.info("Calendar Sync Cron: Starting to emit sync-all event")
|
||||
log_operation('info', "Calendar Sync Cron: Starting to emit sync-all event", context=context)
|
||||
|
||||
# # Emit sync-all event
|
||||
await context.emit({
|
||||
@@ -24,14 +25,14 @@ async def handler(context):
|
||||
}
|
||||
})
|
||||
|
||||
context.logger.info("Calendar Sync Cron: Emitted sync-all event")
|
||||
log_operation('info', "Calendar Sync Cron: Emitted sync-all event", context=context)
|
||||
return {
|
||||
'status': 'completed',
|
||||
'triggered_by': 'cron'
|
||||
}
|
||||
|
||||
except Exception as e:
|
||||
context.logger.error(f"Fehler beim Cron-Job: {e}")
|
||||
log_operation('error', f"Fehler beim Cron-Job: {e}", context=context)
|
||||
return {
|
||||
'status': 'error',
|
||||
'error': str(e)
|
||||
|
||||
Reference in New Issue
Block a user