Releases: agronholm/apscheduler
Releases Β· agronholm/apscheduler
3.11.2
- Fixed an issue where a job using a
CronTriggerscheduled in a repeated time interval during DST transitions could cause the scheduler to get stuck in an infinite loop (#1021; PR by @SoulofAkuma)
3.11.1
- Fixed
scheduler.shutdown()not raisingSchedulerNotRunning(or raising the wrong exception) for asynchronous schedulers when the scheduler is in fact not running - Fixed
CronTriggersticking on a folded datetime during the fall-back DST transition (#1021 <#1021>_; PR by @berianjames)`
4.0.0a6
- BREAKING Refactored
AsyncpgEventBrokerto 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
TaskandScheduleclasses to be read-only - BREAKING Refactored the
release_schedules()data store method to take a sequence ofScheduleResultinstances 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_delayparameter with a new scheduler-level parameter,lease_durationwhich is then used to call the various data store methods - BREAKING Added the
job_result_expiration_timefield to theScheduleclass, to allow the job results from scheduled jobs to stay around for some time (#927) - BREAKING Added an index for the
created_atjob field, so acquiring jobs would be faster when there are a lot of them - BREAKING Removed the
job_executorandmax_running_jobsparameters fromadd_schedule()andadd_run_job()(explicitly configure the task usingconfigure_task()or by using the new@taskdecorator - BREAKING Replaced the
default_job_executorscheduler parameter with a more comprehensivetask_defaultsparameter - Added the
@taskdecorator 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
timezoneargument toCronTrigger.from_crontab()into a keyword-only argument - BREAKING Added the
metadatafield to tasks, schedules and jobs - BREAKING Added logic to store
last_fire_timein datastore implementations (PR by @hlobit) - BREAKING Added the
reap_abandoned_jobs()abstract method toDataStorewhich 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_timeandend_timearguments toCronTrigger.from_crontab()(#676) - Added the
psycopgevent broker - Added useful indexes and removed useless ones in
SQLAlchemyDatastoreandMongoDBDataStore - Changed the
lock_expiration_delayparameter of built-in data stores to accept atimedeltaas well asintorfloat - Fixed serialization error with
CronTriggerwhen pausing a schedule (#864) - Fixed
TypeError: object NoneType can't be used in 'await' expressionat teardown ofSQLAlchemyDataStorewhen it was passed a URL that implicitly created a synchronous engine - Fixed serializers raising their own exceptions instead of
SerializationErrorandDeserializationErroras appropriate - Fixed
repr()outputs of schedulers, data stores and event brokers to be much more useful and reasonable - Fixed race condition in
MongoDBDataStorethat allowed multiple schedulers to acquire the same schedules at once - Changed
SQLAlchemyDataStoreto automatically create the explicitly specified schema if it's missing (PR by @zhu0629) - Fixed an issue with
CronTriggerinfinitely 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)
3.11.0
- Dropped support for Python 3.6 and 3.7
- Added support for
ZoneInfotime zones and deprecated support for pytz time zones - Added
CalendarIntervalTrigger, backported from the 4.x series - Added the ability to export and import jobs via
scheduler.export_jobs()andscheduler.import_jobs(), respectively - Removed the dependency on
six - Changed
ProcessPoolExecutorto spawn new subprocesses from scratch instead of forking on all platform - Fixed
AsyncIOSchedulerinadvertently creating a defunct event loop at start, leading to the scheduler not working at all - Fixed
ProcessPoolExecutornot respecting the passed keyword arguments when a broken pool was being replaced
4.0.0a5
- BREAKING Added the
cleanup()scheduler method and a configuration option (cleanup_interval). A corresponding abstract method was added to theDataStoreclass. This method purges expired job results and schedules that have exhausted their triggers and have no more associated jobs running. Previously, schedules were automatically deleted instantly once their triggers could no longer produce any fire times. - BREAKING Made publishing
JobReleasedevents the responsibility of theDataStoreimplementation, rather than the scheduler, for consistency with theacquire_jobs()method - BREAKING The
started_atfield was moved fromJobtoJobResult - BREAKING Removed the
from_url()class methods ofSQLAlchemyDataStore,MongoDBDataStoreandRedisEventBrokerin favor of the ability to pass a connection url to the initializer - Added the ability to pause and unpause schedules (PR by @WillDaSilva)
- Added the
scheduled_startfield to theJobAcquiredevent - Added the
scheduled_startandstarted_atfields to theJobReleasedevent - Fixed large parts of
MongoDBDataStorestill calling blocking functions in the event loop thread - Fixed JSON serialization of triggers that had been used at least once
- Fixed dialect name checks in the SQLAlchemy job store
- Fixed JSON and CBOR serializers unable to serialize enums
- Fixed infinite loop in CalendarIntervalTrigger with UTC timezone (PR by unights)
- Fixed scheduler not resuming job processing when
max_concurrent_jobshad been reached and then a job was completed, thus making job processing possible again (PR by MohammadAmin Vahedinia) - Fixed the shutdown procedure of the Redis event broker
- Fixed
SQLAlchemyDataStorenot respecting custom schema name when creating enums - Fixed skipped intervals with overlapping schedules in
AndTrigger(#911 <#911>_; PR by Bennett Meares) - Fixed implicitly created client instances in data stores and event brokers not being closed along with the store/broker
4.0.0a4
- BREAKING Renamed any leftover fields named
executortojob_executor(this breaks data store compatibility) - BREAKING Switched to using the timezone aware timestamp column type on Oracle
- BREAKING Fixed precision issue with interval columns on MySQL
- BREAKING Fixed datetime comparison issues on SQLite and MySQL
- BREAKING Worked around datetime microsecond precision issue on MongoDB
- BREAKING Renamed the
worker_idfield toscheduler_idin theJobAcquiredandJobReleasedevents - BREAKING Added the
task_idattribute to theScheduleAdded,ScheduleUpdatedandScheduleRemovedevents - BREAKING Added the
finishedattribute to theScheduleRemovedevent - BREAKING Added the
loggerparameter toDatastore.start()andEventBroker.start()to make both use the scheduler's assigned logger - BREAKING Made the
apscheduler.marshallingmodule private - Added the
configure_task()andget_tasks()scheduler methods - Fixed out of order delivery of events delivered using worker threads
- Fixed schedule processing not setting job start deadlines correctly
4.0.0a3
- BREAKING The scheduler classes were moved to be importable (only) directly from the
apschedulerpackage (apscheduler.Schedulerandapscheduler.AsyncScheduler) - BREAKING Removed the "tags" field in schedules and jobs (this will be added back when the feature has been fully thought through)
- BREAKING Removed the
JobInfoclass in favor of just using theJobclass (which is now immutable) - BREAKING Workers were merged into schedulers. As the
WorkerandAsyncWorkerclasses have been removed, you now need to passrole=SchedulerRole.schedulerto the scheduler to prevent it from processing due jobs. The worker event classes (WorkerEvent,WorkerStarted,WorkerStopped) have also been removed. - BREAKING The synchronous interfaces for event brokers and data stores have been removed. Synchronous libraries can still be used to implement these services through the use of
anyio.to_thread.run_sync(). - BREAKING The
current_workercontext variable has been removed - BREAKING The
current_schedulercontext variable is now specified to only contain the currently running instance of a synchronous scheduler (apscheduler.Scheduler). The asynchronous scheduler instance can be fetched from the newcurrent_async_schedulercontext variable, and will always be available when a scheduler is running in the current context, whilecurrent_scheduleris only available when the synchronous wrapper is being run. - BREAKING Changed the initialization of data stores and event brokers to use a single
start()method that accepts anAsyncExitStack(and, depending on the interface, other arguments too) - BREAKING Added a concept of "job executors". This determines how the task function is executed once picked up by a worker. Several data structures and scheduler methods have a new field/parameter for this,
job_executor. This addition requires database schema changes too. - Dropped support for Python 3.7
- Added support for Python 3.12
- Added the ability to run jobs in worker processes, courtesy of the
processpoolexecutor - Added the ability to run jobs in the Qt event loop via the
qtexecutor - Added the
get_jobs()scheduler method - The synchronous scheduler now runs an asyncio event loop in a thread, acting as a faΓ§ade for
AsyncScheduler - Fixed the
schemaparameter inSQLAlchemyDataStorenot being applied - Fixed SQLalchemy 2.0 compatibility