From ba386e316e16a6f8c4e45ee3830148cdb412498d Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Mon, 13 Jul 2026 20:29:50 +0000 Subject: [PATCH] Fix Resos sync interrupted by health check restart Yield to event loop after each booking DB commit so FastAPI can respond to Docker health checks during long syncs. Co-Authored-By: Claude Sonnet 4.6 --- backend/jobs/resos_bookings_sync.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/jobs/resos_bookings_sync.py b/backend/jobs/resos_bookings_sync.py index f85e4df..c151aed 100644 --- a/backend/jobs/resos_bookings_sync.py +++ b/backend/jobs/resos_bookings_sync.py @@ -3,6 +3,7 @@ Resos Bookings Data Sync Job Syncs restaurant bookings to resos_bookings_data table Pattern: Replicates newbook bookings sync but adapted for Resos covers/stats """ +import asyncio import json import logging from datetime import date, datetime, timedelta @@ -328,6 +329,7 @@ async def sync_resos_bookings_data( records_created += 1 db.commit() + await asyncio.sleep(0) # yield to event loop so health checks pass # Update sync log db.execute(