Skip to content

Commit

Permalink
Change default timeout to match API (90 seconds) (#545)
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 be05cdb commit a7d4fbf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Unreleased
* Improved message sending and draft create/update performance
* Change default timeout to match API (90 seconds)

### 7.2.0 / 2024-02-27
* Added support for `roundTo` field in availability response model
Expand Down
2 changes: 1 addition & 1 deletion src/nylas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class Nylas {
this.apiClient = new APIClient({
apiKey: config.apiKey,
apiUri: config.apiUri || DEFAULT_SERVER_URL,
timeout: config.timeout || 30,
timeout: config.timeout || 90,
});

this.applications = new Applications(this.apiClient);
Expand Down
2 changes: 1 addition & 1 deletion tests/nylas.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Nylas', () => {
});

expect(nylas.apiClient.serverUrl).toBe('https://api.us.nylas.com');
expect(nylas.apiClient.timeout).toBe(30000);
expect(nylas.apiClient.timeout).toBe(90000);
});
});
});

0 comments on commit a7d4fbf

Please sign in to comment.