refactor(logging): standardize status code handling and enhance logging in webhook and cron handlers
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user