-
Notifications
You must be signed in to change notification settings - Fork 13
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
TDL-16368 add request timeout #19
Conversation
Co-authored-by: Umang Agrawal <80704207+umangagrawal-crest@users.noreply.github.com>
…om/singer-io/tap-recharge into TDL-16368-implenet-request-timeout
# Backoff the request for 5 times when Timeout or Connection error occurs | ||
@backoff.on_exception( | ||
backoff.expo, | ||
(Timeout, requests.ConnectionError), | ||
max_tries=5, | ||
factor=2) |
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.
@namrata270998 Can we merge the above backoff with the already available backoff on check_access_token
function for consistency?
tap-recharge/tap_recharge/client.py
Lines 133 to 138 in acbcb56
@backoff.on_exception( | |
backoff.expo, | |
Server5xxError, | |
max_tries=5, | |
factor=2) | |
def check_access_token(self): |
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 cannot merge the 2 backoffs as the check_access_token()
is also called from the request()
function which has a backoff. Hence, to avoid more than 5 times backoff, it is placed on the top of __enter__()
Description of change
Added request timeout for API requests with default timeout 300 seconds
Manual QA steps
Risks
Rollback steps