async def _scheduler_loop(self):
        """Main scheduler loop that checks for due syncs."""
        logger.debug("Scheduler loop started")
        loop_count = 0

        while self.running:
            loop_count += 1
            loop_start_time = datetime.now(timezone.utc)
            logger.debug(f"Starting scheduler loop iteration #{loop_count}")

            try:
                await self._check_syncs()
            except Exception as e:
                logger.error(f"Error in scheduler loop: {e}", exc_info=True)

            # Calculate how long this loop iteration took
            loop_duration = (datetime.now(timezone.utc) - loop_start_time).total_seconds()
            logger.debug(
                f"Scheduler loop iteration #{loop_count} completed in {loop_duration:.3f}s"
            )

            # Sleep for the check interval
            await asyncio.sleep(self.check_interval)
Main scheduler loop that checks for due syncs.
backend/airweave/platform/scheduler.py