Skip to content

fix(http): fall back to self.timeout in AsyncTwilioHttpClient.request#928

Open
nileshpatil6 wants to merge 1 commit into
twilio:mainfrom
nileshpatil6:fix/async-http-client-timeout-fallback
Open

fix(http): fall back to self.timeout in AsyncTwilioHttpClient.request#928
nileshpatil6 wants to merge 1 commit into
twilio:mainfrom
nileshpatil6:fix/async-http-client-timeout-fallback

Conversation

@nileshpatil6
Copy link
Copy Markdown

Fixes #925

AsyncTwilioHttpClient.request did not use self.timeout when the timeout parameter was None, unlike the sync TwilioHttpClient. The timeout set on the client was silently ignored in async usage.

Match the sync behavior: fall back to self.timeout when timeout is None.

Before:

if timeout is not None and timeout <= 0:
    raise ValueError(timeout)

After:

if timeout is None:
    timeout = self.timeout
elif timeout <= 0:
    raise ValueError(timeout)

When the timeout argument is None, AsyncTwilioHttpClient.request did not
fall back to self.timeout, unlike the sync TwilioHttpClient. This meant
the timeout configured on the client had no effect in async usage.

Match the sync behavior: if timeout is None, use self.timeout.

Fixes twilio#925

Signed-off-by: nileshpatil6 <technil6436@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AsyncTwilioHttpClient.request does not use self.timeout

1 participant