Refresh active crewed mission cache in updater

Closes #175
This commit is contained in:
Edward Betts 2026-02-21 16:08:45 +00:00
parent a275683f90
commit 458dfc5136

View file

@ -264,6 +264,12 @@ def update_thespacedevs(config: flask.config.Config) -> None:
existing_data = agenda.thespacedevs.load_cached_launches(rocket_dir) existing_data = agenda.thespacedevs.load_cached_launches(rocket_dir)
assert existing_data assert existing_data
# Refresh active crewed mission cache used by the launches page.
# Failures are handled internally with cache fallback.
active_crewed = agenda.thespacedevs.get_active_crewed_flights(
rocket_dir, refresh=True
)
# Always follow configured slugs # Always follow configured slugs
follow_slugs: set[str] = set(config["FOLLOW_LAUNCHES"]) follow_slugs: set[str] = set(config["FOLLOW_LAUNCHES"])
@ -313,6 +319,7 @@ def update_thespacedevs(config: flask.config.Config) -> None:
return return
rockets = [agenda.thespacedevs.summarize_launch(item) for item in data["results"]] rockets = [agenda.thespacedevs.summarize_launch(item) for item in data["results"]]
print(len(rockets), "launches") print(len(rockets), "launches")
print(len(active_crewed or []), "active crewed missions")
print(f"took {time_taken:.1f} seconds") print(f"took {time_taken:.1f} seconds")