summaryrefslogtreecommitdiff
path: root/docs/migration.rst
blob: 2d0d2265602b349915039e267abe6c9d91f9959f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
###############################################
Migrating from previous versions of APScheduler
###############################################

From v2.x to 3.0
================

The 3.0 series is API incompatible with previous releases due to a design overhaul.

Configuration changes
---------------------

* The "operating mode" concept is gone -- use either BlockingScheduler or BackgroundScheduler directly

Scheduler API changes
---------------------

* The trigger-specific scheduling methods have been removed entirely from the
  Scheduler class. Instead, you have to use the
  :meth:`~apscheduler.schedulers.base.BaseScheduler.add_job` method or the
  :meth:`~apscheduler.schedulers.base.BaseScheduler.scheduled_job` decorator, giving the
  entry point name of the trigger, or an already constructed instance.
  It should also be noted that the signature of
  :meth:`~apscheduler.schedulers.base.BaseScheduler.add_job` has changed due to this.
* The "simple" trigger has been renamed to "date"
* The old thread pool is gone and it is replaced by :class:`~apscheduler.executors.pool.PoolExecutor`

Job store changes
-----------------

The job store system was completely overhauled for both efficiency and forwards compatibility.
Unfortunately, this means that the old data is not compatible with the new job stores.
If you need to migrate existing data from APScheduler 2.x to 3.x, contact the APScheduler author.


From v1.x to 2.0
================

There have been some API changes since the 1.x series. This document
explains the changes made to v2.0 that are incompatible with the v1.x API.

API changes
-----------

* The behavior of cron scheduling with regards to default values for omitted
  fields has been made more intuitive -- omitted fields lower than the least
  significant explicitly defined field will default to their minimum values
  except for the week number and weekday fields
* SchedulerShutdownError has been removed -- jobs are now added tentatively
  and scheduled for real when/if the scheduler is restarted
* Scheduler.is_job_active() has been removed -- use
  ``job in scheduler.get_jobs()`` instead
* dump_jobs() is now print_jobs() and prints directly to the given file or
  sys.stdout if none is given
* The ``repeat`` parameter was removed from
  :meth:`~apscheduler.scheduler.Scheduler.add_interval_job` and
  :meth:`~apscheduler.scheduler.Scheduler.interval_schedule` in favor of the
  universal ``max_runs`` option
* :meth:`~apscheduler.scheduler.Scheduler.unschedule_func` now raises a
  KeyError if the given function is not scheduled
* The semantics of :meth:`~apscheduler.scheduler.Scheduler.shutdown` have
  changed -- the method no longer accepts a numeric argument, but two booleans


Configuration changes
---------------------

* The scheduler can no longer be reconfigured while it's running