-
Notifications
You must be signed in to change notification settings - Fork 72
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
Retry api call #1691
Retry api call #1691
Conversation
@bdrhn9 @amarthadan thoughts on which is better ? |
I see. Well, if we want to avoid Axios blocking file descriptors we should go with option 2. I don't think having those few extra lines is a big deal. |
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.
The extra complexity with TIMEOUT/3
and TIMEOUT*2/3
is not worth it. I think it's better to define two constants FIRST_API_CALL_TIMEOUT and SECOND_API_CALL_TIMEOUT.
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 after the naming improvements.
closes #1658
There are two ways to have 2 attempts one of them is this:
The
go
function will take 10s and 20s for each attempt before it timeouts, however the timeout that is passed to adapter cannot be adjusted dynamically for each attempt which means we have to supply the max timeout which will block the axios socket for an extra 10 seconds in the first attempt if the api call failsThe other way is:
This doesn't block but has extra lines of code