summaryrefslogtreecommitdiff
path: root/src/apscheduler
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2022-08-09 00:01:46 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2022-08-09 00:02:05 +0300
commit93b219bf31a2638722c21f4ce44fe7c1d735ca45 (patch)
tree9c402c1399e767e38d4f6fb23554cecd1ec35154 /src/apscheduler
parentea0ed61cf3bfd24a2e0b9441e090a7be975dea98 (diff)
downloadapscheduler-93b219bf31a2638722c21f4ce44fe7c1d735ca45.tar.gz
Added get_schedules() methods to the scheduler classes
Diffstat (limited to 'src/apscheduler')
-rw-r--r--src/apscheduler/schedulers/async_.py9
-rw-r--r--src/apscheduler/schedulers/sync.py10
2 files changed, 19 insertions, 0 deletions
diff --git a/src/apscheduler/schedulers/async_.py b/src/apscheduler/schedulers/async_.py
index bc99567..6c60bdd 100644
--- a/src/apscheduler/schedulers/async_.py
+++ b/src/apscheduler/schedulers/async_.py
@@ -177,6 +177,15 @@ class AsyncScheduler:
else:
raise ScheduleLookupError(id)
+ async def get_schedules(self) -> list[Schedule]:
+ """
+ Retrieve all schedules from the data store.
+
+ :return: a list of schedules, in an unspecified order
+
+ """
+ return await self.data_store.get_schedules()
+
async def remove_schedule(self, id: str) -> None:
"""
Remove the given schedule from the data store.
diff --git a/src/apscheduler/schedulers/sync.py b/src/apscheduler/schedulers/sync.py
index e64d43c..aea7047 100644
--- a/src/apscheduler/schedulers/sync.py
+++ b/src/apscheduler/schedulers/sync.py
@@ -207,6 +207,16 @@ class Scheduler:
else:
raise ScheduleLookupError(id)
+ def get_schedules(self) -> list[Schedule]:
+ """
+ Retrieve all schedules from the data store.
+
+ :return: a list of schedules, in an unspecified order
+
+ """
+ self._ensure_services_ready()
+ return self.data_store.get_schedules()
+
def remove_schedule(self, id: str) -> None:
"""
Remove the given schedule from the data store.