From 8032cd2ed4702507c01b7477edf88ae32b1a3755 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 5 Aug 2024 14:02:45 +0200 Subject: [PATCH] Increase rocket lanuch limit from 200 to 500 --- agenda/thespacedevs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/agenda/thespacedevs.py b/agenda/thespacedevs.py index 8168d8c..acc6758 100644 --- a/agenda/thespacedevs.py +++ b/agenda/thespacedevs.py @@ -15,8 +15,10 @@ Summary = dict[str, typing.Any] ttl = 60 * 60 * 2 # two hours +LIMIT = 500 -def next_launch_api_data(rocket_dir: str, limit: int = 200) -> StrDict | None: + +def next_launch_api_data(rocket_dir: str, limit: int = LIMIT) -> StrDict | None: """Get the next upcoming launches from the API.""" now = datetime.now() filename = os.path.join(rocket_dir, now.strftime("%Y-%m-%d_%H:%M:%S.json")) @@ -32,7 +34,7 @@ def next_launch_api_data(rocket_dir: str, limit: int = 200) -> StrDict | None: return data -def next_launch_api(rocket_dir: str, limit: int = 200) -> list[Summary] | None: +def next_launch_api(rocket_dir: str, limit: int = LIMIT) -> list[Summary] | None: """Get the next upcoming launches from the API.""" data = next_launch_api_data(rocket_dir, limit) if not data: @@ -157,7 +159,7 @@ def read_cached_launches(rocket_dir: str) -> list[Summary]: def get_launches( - rocket_dir: str, limit: int = 200, refresh: bool = False + rocket_dir: str, limit: int = LIMIT, refresh: bool = False ) -> list[Summary] | None: """Get rocket launches with caching.""" now = datetime.now()