-
Notifications
You must be signed in to change notification settings - Fork 152
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
Added logic for request timeouts #90
Conversation
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.
Your changes look good, I left some minor comments about formatting. Thanks for submitting this!
plaid/requester.py
Outdated
@@ -8,10 +8,10 @@ | |||
|
|||
|
|||
ALLOWED_METHODS = {'post'} | |||
TIMEOUT = 600 # 10 minutes | |||
DEFAULT_TIMEOUT = 600 # 10 minutes |
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.
Could you make this two spaces between 600
and the comment? (PEP 8)
plaid/client.py
Outdated
@@ -93,5 +97,5 @@ def post_public_key(self, path, data): | |||
def _post(self, path, data): | |||
return post_request( | |||
urljoin('https://' + self.environment + '.plaid.com', path), | |||
data=data, | |||
data=data, timeout=self.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.
Could you please put timeout=self.timeout
on a new line?
okay, I have made the requested updates |
Motivation
Many of the newer institutions (especially for Auth and Identity) take several minutes to receive a response. It would be ideal for anyone consuming this API to be able to set a timeout as they would for any other request.
This PR adds a
timeout
argument to the Client() object; all API requests are then limited to the specified timeout, else aReadTimeoutError
is raised.