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

Add more conditions for retries #194

Open
3 of 6 tasks
MatthewFlamm opened this issue May 2, 2024 · 3 comments
Open
3 of 6 tasks

Add more conditions for retries #194

MatthewFlamm opened this issue May 2, 2024 · 3 comments

Comments

@MatthewFlamm
Copy link
Owner

MatthewFlamm commented May 2, 2024

It might be useful to have other conditions kick off retry attempts, e.g.

  • blank observations (e.g. [] returned)
  • blank forecasts being returned (see above)
  • outdated observations being returned
  • outdated forecasts being returned
  • detailed Forecasts
  • all alerts updates. (Not useful?)
@MatthewFlamm
Copy link
Owner Author

A problem with the current use of call_with_retry that wraps any update_* call is that is is harder to make special cases for update_observation for example.

@MatthewFlamm
Copy link
Owner Author

MatthewFlamm commented May 3, 2024

One thought that I like is to have a new keyword arg for each update_* method that would raise an error when some condition is met for the data coming back from the update. We could use NWSError or subclass from it.

This would allow us to catch those specific errors in the retry, it also allows downstream codes to catch them.

@MatthewFlamm
Copy link
Owner Author

Observations already allow a start_time parameter, right now we trust NWS to satisfy this request. We should also filter it if user supplies this and NWS returns old data.

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

No branches or pull requests

1 participant