-
Notifications
You must be signed in to change notification settings - Fork 307
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
fix: add timeout for auth requests #1616
base: main
Are you sure you want to change the base?
Conversation
@@ -184,6 +185,7 @@ def __call__( | |||
""" | |||
try: | |||
_LOGGER.debug("Making request: %s %s", method, url) | |||
timeout = timeout if timeout != _DEFAULT_TIMEOUT else 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.
There is an edge case where someone sets t1 at the object level but they want default timeout for a specific request. They have no way of doing that now. Even if default timeout is passed to call explicitly, it is going to use the object level one.
@@ -137,9 +137,10 @@ class Request(transport.Request): | |||
.. automethod:: __call__ | |||
""" | |||
|
|||
def __init__(self, session=None): |
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.
@@ -137,9 +137,10 @@ class Request(transport.Request): | |||
.. automethod:: __call__ | |||
""" | |||
|
|||
def __init__(self, session=None): |
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.
Checkout how AuthorizedSession is handling the timeouts and see if we can adapt same. I see something about TimeGuards there as well.
expose a parameter in the request constructor to allow the end user to pass in the custom timeout value. Currently _DEFAULT_TIMEOUT is being used, which may not be suitable for all the users