Skip to main content

prefect.server.services.scheduler

The Scheduler service. This service schedules flow runs from deployments with active schedules.

Functions

schedule_deployments

schedule_deployments(perpetual: Perpetual = Perpetual(automatic=False, every=timedelta(seconds=get_current_settings().server.services.scheduler.loop_seconds))) -> None
Main scheduler - schedules flow runs from deployments with active schedules. Schedule flow runs by:
  • Querying for deployments with active schedules
  • Generating the next set of flow runs based on each deployment’s schedule
  • Inserting all scheduled flow runs into the database

schedule_recent_deployments

schedule_recent_deployments(perpetual: Perpetual = Perpetual(automatic=False, every=timedelta(seconds=get_current_settings().server.services.scheduler.recent_deployments_loop_seconds))) -> None
Recent deployments scheduler - schedules deployments that were updated very recently. This scheduler runs on a tight loop and ensures that runs from newly-created or updated deployments are rapidly scheduled without waiting for the main scheduler. Note that scheduling is idempotent, so it’s okay for this scheduler to attempt to schedule the same deployments as the main scheduler.

Classes

TryAgain

Internal control-flow exception used to retry the Scheduler’s main loop