Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

astroquery cache should fall back to expired cache if remote fails #2909

Open
aripollak opened this issue Dec 27, 2023 · 1 comment
Open

Comments

@aripollak
Copy link
Member

aripollak commented Dec 27, 2023

Some API backends (like MPC) have extended downtimes, and there is currently not easy way to tell astroquery (post-0.4.6 / #1634) to fall back to an existing expired cached response if the request raises an exception, while still respecting the regular cache expiration for successful requests.
In requests-cache, the equivalent setting would be stale_if_error=True. Maybe switching to requests-cache would be a good improvement, since it would allow deep customization of caching behavior, like an offline mode with only_if_cached=True.

@bsipocz
Copy link
Member

bsipocz commented Jan 8, 2024

Adding request-cache as a dependency would come with some risks (it looks to be a single person project), but it's currently active and seems to have a sizeable downstream user group.
However, I don't think making the switch gets high enough on the maintainers' todo any time soon, so contributions towards it from the most affected modules would be desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants