- BREAKING Refactored
AsyncpgEventBroker
to directly accept a connection string, thus eliminating the need for theAsyncpgEventBroker.from_dsn()
class method - BREAKING Added the
extend_acquired_schedule_leases()
data store method to prevent other schedulers from acquiring schedules already being processed by a scheduler, if that's taking unexpectedly long for some reason - BREAKING Added the
extend_acquired_job_leases()
data store method to prevent jobs from being cleaned up as if they had been abandoned (#864) - BREAKING Changed the
cleanup()
data store method to also be responsible for releasing jobs whose leases have expired (so the schedulers responsible for them have probably died) - BREAKING Changed most attributes in
Task
andSchedule
classes to be read-only - BREAKING Refactored the
release_schedules()
data store method to take a sequence ofScheduleResult
instances instead of a sequence of schedules, to enable the memory data store to handle schedule updates more efficiently - BREAKING Replaced the data store
lock_expiration_delay
parameter with a new scheduler-level parameter,lease_duration
which is then used to call the various data store methods - BREAKING Added the
job_result_expiration_time
field to theSchedule
class, to allow the job results from scheduled jobs to stay around for some time (#927) - BREAKING Added an index for the
created_at
job field, so acquiring jobs would be faster when there are a lot of them - BREAKING Removed the
job_executor
andmax_running_jobs
parameters fromadd_schedule()
andadd_run_job()
(explicitly configure the task usingconfigure_task()
or by using the new@task
decorator - BREAKING Replaced the
default_job_executor
scheduler parameter with a more comprehensivetask_defaults
parameter - Added the
@task
decorator for specifying task configuration parameters bound to a function - BREAKING Changed tasks to only function as job templates as well as buckets to limit maximum concurrent job execution
- BREAKING Changed the
timezone
argument toCronTrigger.from_crontab()
into a keyword-only argument - BREAKING Added the
metadata
field to tasks, schedules and jobs - BREAKING Added logic to store
last_fire_time
in datastore implementations (PR by @hlobit) - BREAKING Added the
reap_abandoned_jobs()
abstract method toDataStore
which the scheduler calls before processing any jobs in order to immediately mark jobs left in an acquired state when the scheduler crashed - Added the
start_time
andend_time
arguments toCronTrigger.from_crontab()
(#676) - Added the
psycopg
event broker - Added useful indexes and removed useless ones in
SQLAlchemyDatastore
andMongoDBDataStore
- Changed the
lock_expiration_delay
parameter of built-in data stores to accept atimedelta
as well asint
orfloat
- Fixed serialization error with
CronTrigger
when pausing a schedule (#864) - Fixed
TypeError: object NoneType can't be used in 'await' expression
at teardown ofSQLAlchemyDataStore
when it was passed a URL that implicitly created a synchronous engine - Fixed serializers raising their own exceptions instead of
SerializationError
andDeserializationError
as appropriate - Fixed
repr()
outputs of schedulers, data stores and event brokers to be much more useful and reasonable - Fixed race condition in
MongoDBDataStore
that allowed multiple schedulers to acquire the same schedules at once - Changed
SQLAlchemyDataStore
to automatically create the explicitly specified schema if it's missing (PR by @zhu0629) - Fixed an issue with
CronTrigger
infinitely looping to get next date when DST ends (#980; PR by @hlobit) - Skip dispatching extend_acquired_job_leases with no jobs (PR by @JacobHayes)
- Fixed schedulers not immediately processing schedules that the scheduler left in an acquired state after a crash
- Fixed the job lease extension task exiting prematurely while the scheduler is starting (PR by @JacobHayes)
- Migrated test and documentation dependencies from extras to dependency groups
- Fixed
add_job()
overwriting task configuration (PR by @mattewid)