From ce786a7450d35e336a44cb0b5fe8f5dced784d62 Mon Sep 17 00:00:00 2001 From: Mostafa Rashed <17770919+mrashed-dev@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:00:52 -0500 Subject: [PATCH] Change default timeout to match API (90 seconds) (#353) 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. --- CHANGELOG.md | 4 ++++ nylas/client.py | 2 +- tests/test_client.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7396839d..87662ff2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/nylas/client.py b/nylas/client.py index 6ce8e9b5..00b5ad8c 100644 --- a/nylas/client.py +++ b/nylas/client.py @@ -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. diff --git a/tests/test_client.py b/tests/test_client.py index 139874d8..3fd84b67 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -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