refactor(logging): standardize status code handling and enhance logging in webhook and cron handlers

This commit is contained in:
bsiggel
2026-03-08 22:09:22 +00:00
parent a0cf845877
commit 1c765d1eec
15 changed files with 61 additions and 64 deletions

View File

@@ -24,10 +24,13 @@ config = {
}
async def handler(input_data: Dict[str, Any], ctx: FlowContext) -> None:
async def handler(input_data: None, ctx: FlowContext) -> None:
"""Cron handler that triggers the calendar sync cascade."""
try:
log_operation('info', "Calendar Sync Cron: Starting to emit sync-all event", context=ctx)
ctx.logger.info("=" * 80)
ctx.logger.info("🕐 CALENDAR SYNC CRON: STARTING")
ctx.logger.info("=" * 80)
ctx.logger.info("Emitting sync-all event")
# Enqueue sync-all event
await ctx.enqueue({
@@ -37,7 +40,11 @@ async def handler(input_data: Dict[str, Any], ctx: FlowContext) -> None:
}
})
log_operation('info', "Calendar Sync Cron: Emitted sync-all event", context=ctx)
ctx.logger.info("Calendar sync-all event emitted successfully")
ctx.logger.info("=" * 80)
except Exception as e:
log_operation('error', f"Fehler beim Cron-Job: {e}", context=ctx)
ctx.logger.error("=" * 80)
ctx.logger.error("❌ ERROR: CALENDAR SYNC CRON")
ctx.logger.error(f"Error: {e}")
ctx.logger.error("=" * 80)