Increase rocket lanuch limit from 200 to 500

This commit is contained in:
Edward Betts 2024-08-05 14:02:45 +02:00
parent bd129aea5c
commit 8032cd2ed4

View file

@ -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()