Skip to content

synchronize()

async Class: JobsAustriaCacheProcessRework
File: jobs_austria_cache_key_sync.py ยท line 107

Async loop that runs every 30 seconds and stops ONLY when scrape_cache is clear.

Signature

Parameters none
Returns not annotated
Async Yes
Visibility Public

Implementation

async def synchronize(self):
    """Async loop that runs every 30 seconds and stops ONLY when scrape_cache is clear."""
    logs.info("Starting asynchronous synchronization loop...")

    while True:
        has_pending_rows = await asyncio.to_thread(self.run_cycle)

        if not has_pending_rows:
            logs.info("No more pending rows found in scrape_cache. Stopping.")
            break

        logs.info(f"Waiting {POLL_INTERVAL} seconds for next check...")
        await asyncio.sleep(POLL_INTERVAL)