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
CLOUDP-237245: Add example for retrying requests #294
Conversation
12f3972 was added to not got pinged on dependabot updates for examples. No strong opinion if we want that and we can easily remove this commit if needed. |
@gssbzn Based on your feedback we have:
Let me know if I miss anything |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is testify still needed here, could we go mod tidy
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do:
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Co-authored-by: Gustavo Bazan <gustavo.bazan@mongodb.com>
Co-authored-by: Gustavo Bazan <gustavo.bazan@mongodb.com>
Co-authored-by: Gustavo Bazan <gustavo.bazan@mongodb.com>
Co-authored-by: Gustavo Bazan <gustavo.bazan@mongodb.com>
I would prefer if we do OpenAPI generator update in the follow up PR as this might involve +60 different file changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
### Retry Example | ||
|
||
Example provides automatic retries for all HTTP 500, 429 HTTP status errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, personally blindly retrying on the Atlas API is not safe and a bad idea
Description
Adding example that would support
Tested manually by using API mocks (thanks to @lantoli) for different network issues and status codes.
All works end to end.
Testing