prefect.server.services.scheduler
The Scheduler service.
Classes
TryAgain
Internal control-flow exception used to retry the Scheduler’s main loop
Scheduler
Schedules flow runs from deployments.
Methods:
run_once
- Querying for deployments with active schedules
- Generating the next set of flow runs based on each deployments schedule
- Inserting all scheduled flow runs into the database
run_once
LoopService().start(loops=1)
instead of LoopService().run_once()
, because this method will not invoke setup
and teardown methods properly.
service_settings
start
stop
block
: if True, blocks until the service is finished running. Otherwise it requests a stop and returns but the service may still be running a final loop.
RecentDeploymentsScheduler
Schedules deployments that were updated very recently
This scheduler can run on a tight loop and ensure that runs from
newly-created or updated deployments are rapidly scheduled without having to
wait for the “main” scheduler to complete its loop.
Note that scheduling is idempotent, so its ok for this scheduler to attempt
to schedule the same deployments as the main scheduler. It’s purpose is to
accelerate scheduling for any deployments that users are interacting with.
Methods:
run_once
- Querying for deployments with active schedules
- Generating the next set of flow runs based on each deployments schedule
- Inserting all scheduled flow runs into the database