Skip to content

Commit

Permalink
Change default timeout to match API (90 seconds) (#353)
Browse files Browse the repository at this point in the history
The API's default timeout is 90 seconds, so it's best we match that. We have updated the default value to match this, user can still override the default.
  • Loading branch information
mrashed-dev authored Mar 4, 2024
1 parent 4a597e3 commit ce786a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
nylas-python Changelog
======================

Unreleased
----------------
* Change default timeout to match API (90 seconds)

v6.1.0
----------------
* Added support for `round_to` field in availability response
Expand Down
2 changes: 1 addition & 1 deletion nylas/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Client:
"""

def __init__(
self, api_key: str, api_uri: str = DEFAULT_SERVER_URL, timeout: int = 30
self, api_key: str, api_uri: str = DEFAULT_SERVER_URL, timeout: int = 90
):
"""
Initialize the Nylas API client.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_client_init_defaults(self):

assert client.api_key == "test-key"
assert client.api_uri == "https://api.us.nylas.com"
assert client.http_client.timeout == 30
assert client.http_client.timeout == 90

def test_client_auth_property(self, client):
assert client.auth is not None
Expand Down

0 comments on commit ce786a7

Please sign in to comment.