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 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-13 20:29:50 +00:00
parent 0563ad7fc2
commit ba386e316e

View file

@ -3,6 +3,7 @@ Resos Bookings Data Sync Job
Syncs restaurant bookings to resos_bookings_data table Syncs restaurant bookings to resos_bookings_data table
Pattern: Replicates newbook bookings sync but adapted for Resos covers/stats Pattern: Replicates newbook bookings sync but adapted for Resos covers/stats
""" """
import asyncio
import json import json
import logging import logging
from datetime import date, datetime, timedelta from datetime import date, datetime, timedelta
@ -328,6 +329,7 @@ async def sync_resos_bookings_data(
records_created += 1 records_created += 1
db.commit() db.commit()
await asyncio.sleep(0) # yield to event loop so health checks pass
# Update sync log # Update sync log
db.execute( db.execute(