summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2014-07-07 06:54:54 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2014-07-07 06:54:54 +0300
commitd25ba3c155fdda3521c8bda4b40a3c8597f2fdbd (patch)
treef41f8944e041004333c5be3cf0922e6d81fe7b89
parent8e8c6676239ec91729b79a34a1a6c652b89cfbd7 (diff)
downloadapscheduler-d25ba3c155fdda3521c8bda4b40a3c8597f2fdbd.tar.gz
Clarified the requirements for get_due_jobs() and get_all_jobs() in BaseJobStore
-rw-r--r--apscheduler/jobstores/base.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/apscheduler/jobstores/base.py b/apscheduler/jobstores/base.py
index 7ac44c3..e09e40a 100644
--- a/apscheduler/jobstores/base.py
+++ b/apscheduler/jobstores/base.py
@@ -65,7 +65,8 @@ class BaseJobStore(six.with_metaclass(ABCMeta)):
@abstractmethod
def get_due_jobs(self, now):
"""
- Returns the list of jobs that have ``next_run_time`` earlier or equal to ``now``, sorted by next run time
+ Returns the list of jobs that have ``next_run_time`` earlier or equal to ``now``.
+ The returned jobs must be sorted by next run time (ascending).
:param datetime.datetime now: the current (timezone aware) datetime
:rtype: list[Job]
@@ -82,7 +83,8 @@ class BaseJobStore(six.with_metaclass(ABCMeta)):
@abstractmethod
def get_all_jobs(self):
"""
- Returns a list of all contained jobs (sorted by next run time).
+ Returns a list of all jobs in this job store. The returned jobs should be sorted by next run time (ascending).
+ Paused jobs (next_run_time == None) should be sorted last.
The job store is responsible for setting the ``scheduler`` and ``jobstore`` attributes of the returned jobs to
point to the scheduler and itself, respectively.