Skip to content

Commit

Permalink
Change default timeout to match API (90 seconds) (#218)
Browse files Browse the repository at this point in the history
# Description
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.

# License
<!-- Your PR comment must contain the following line for us to merge the
PR. -->
I confirm that this contribution is made under the terms of the MIT
license and that I have the authority necessary to make this
contribution on behalf of its copyright owner.
  • Loading branch information
mrashed-dev committed Mar 4, 2024
1 parent baa8d8a commit 88da3b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Nylas Java SDK Changelog

## Unreleased

### Changed
* Change default timeout to match API (90 seconds)

## [2.2.0] - Released 2024-02-27

### Added
Expand Down
12 changes: 6 additions & 6 deletions src/main/kotlin/com/nylas/NylasClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ class NylasClient(
*
* By default, the NylasClient configures it as follows:
* .protocols(Arrays.asList(Protocol.HTTP_1_1))
* .connectTimeout(60, TimeUnit.SECONDS)
* .readTimeout(60, TimeUnit.SECONDS)
* .writeTimeout(60, TimeUnit.SECONDS)
* .connectTimeout(90, TimeUnit.SECONDS)
* .readTimeout(90, TimeUnit.SECONDS)
* .writeTimeout(90, TimeUnit.SECONDS)
* .addNetworkInterceptor(new HttpLoggingInterceptor()
*
* @param httpClient The custom OkHttpClient.Builder to use.
Expand All @@ -500,9 +500,9 @@ class NylasClient(
val DEFAULT_BASE_URL = Region.US.nylasApiUrl
private fun defaultHttpClient(): OkHttpClient.Builder {
return OkHttpClient.Builder()
.connectTimeout(60, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.connectTimeout(90, TimeUnit.SECONDS)
.readTimeout(90, TimeUnit.SECONDS)
.writeTimeout(90, TimeUnit.SECONDS)
.protocols(listOf(Protocol.HTTP_1_1))
.addNetworkInterceptor(HttpLoggingInterceptor())
}
Expand Down

0 comments on commit 88da3b5

Please sign in to comment.