-
Notifications
You must be signed in to change notification settings - Fork 19
TDL-16323: Add request timeout #47
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
Conversation
umangagrawal-crest
left a comment
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.
@harshpatel4crest Please update the readme and sample config file
Updated readme file and sample config file. |
| # get the value of request timeout from config | ||
| config_request_timeout = args.config.get('request_timeout') | ||
|
|
||
| if config_request_timeout and float(config_request_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.
Add detailed comment over if condition.
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.
I can't see the meaning of using the request_timeout variable.
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.
Updated the code and returned the value directly.
tap_klaviyo/utils.py
Outdated
| request_timeout = float(config_request_timeout) | ||
| # return the timeout from config | ||
| return request_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.
| request_timeout = float(config_request_timeout) | |
| # return the timeout from config | |
| return request_timeout | |
| return float(config_request_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.
Updated.
tests/unittests/test_timeout.py
Outdated
| except requests.Timeout: | ||
| pass | ||
|
|
||
| # verfiy that we backoff for 5 times |
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.
| # verfiy that we backoff for 5 times | |
| # verify that we backoff for 5 times |
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.
Updated.
tests/unittests/test_timeout.py
Outdated
| except requests.ConnectionError: | ||
| pass | ||
|
|
||
| # verfiy that we backoff for 5 times |
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.
| # verfiy that we backoff for 5 times | |
| # verify that we backoff for 5 times |
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.
Updated.
Description of change
TDL-16323: Add request timeout
Manual QA steps
Risks
Rollback steps