Fix scheduled Newbook sync — await the coroutine instead of run_in_executor
run_fetch_current_rates is async; run_in_executor called it in a thread and discarded the coroutine, so the daily scheduled sync silently did nothing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
33d466ed73
commit
c924d793e8
1 changed files with 3 additions and 3 deletions
|
|
@ -70,10 +70,10 @@ async def run_scheduled_booking_scrape_async():
|
|||
|
||||
async def run_scheduled_fetch_current_rates():
|
||||
if is_sync_enabled("newbook_current_rates"):
|
||||
# run_fetch_current_rates is a coroutine — await it directly;
|
||||
# run_in_executor would return the coroutine object unawaited
|
||||
from jobs.fetch_current_rates import run_fetch_current_rates
|
||||
import asyncio
|
||||
loop = asyncio.get_event_loop()
|
||||
await loop.run_in_executor(None, run_fetch_current_rates)
|
||||
await run_fetch_current_rates()
|
||||
else:
|
||||
logger.debug("Newbook current rates sync skipped (disabled)")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue