fix: replace return dicts with raise in calendar_sync_all queue handler – enables Motia retry on failure
This commit is contained in:
@@ -49,7 +49,7 @@ async def handler(input_data: Dict[str, Any], ctx: FlowContext) -> None:
|
||||
employees = await get_advoware_employees(advoware, ctx)
|
||||
if not employees:
|
||||
log_operation('error', "Keine Mitarbeiter gefunden. All-Sync abgebrochen.", context=ctx)
|
||||
return {'status': 500, 'body': {'error': 'Keine Mitarbeiter gefunden'}}
|
||||
raise RuntimeError("Keine Mitarbeiter gefunden. All-Sync abgebrochen.")
|
||||
|
||||
redis_client = get_redis_client(ctx)
|
||||
|
||||
@@ -99,15 +99,7 @@ async def handler(input_data: Dict[str, Any], ctx: FlowContext) -> None:
|
||||
emitted_count += 1
|
||||
|
||||
log_operation('info', f"Calendar Sync All: Completed, emitted {emitted_count} events", context=ctx)
|
||||
return {
|
||||
'status': 'completed',
|
||||
'triggered_by': triggered_by,
|
||||
'emitted_count': emitted_count
|
||||
}
|
||||
|
||||
except Exception as e:
|
||||
log_operation('error', f"Fehler beim All-Sync: {e}", context=ctx)
|
||||
return {
|
||||
'status': 'error',
|
||||
'error': str(e)
|
||||
}
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user