Skip to content

Commit 0ed060f

Browse files
authored
Added keep alive (notice) (#1094)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Clarifies connection behavior in JS SDK API clients; no functional changes. > > - Adds inline comments in `api/index.ts` and `envd/api.ts` noting that undici keeps connections alive by default and leaves `keepalive` commented out > - No code path, config, or runtime behavior modified > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 127f6fe. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 6371d0c commit 0ed060f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/js-sdk/src/api/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ class ApiClient {
7474

7575
this.api = createClient<paths>({
7676
baseUrl: config.apiUrl,
77-
// keepalive: true, // TODO: Return keepalive
77+
// In HTTP 1.1, all connections are considered persistent unless declared otherwise
78+
// keepalive: true,
7879
headers: {
7980
...defaultHeaders,
8081
...(config.apiKey && { 'X-API-KEY': config.apiKey }),

packages/js-sdk/src/envd/api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ class EnvdApiClient {
113113
baseUrl: config.apiUrl,
114114
fetch: config?.fetch,
115115
headers: config?.headers,
116-
// keepalive: true, // TODO: Return keepalive
116+
// In HTTP 1.1, all connections are considered persistent unless declared otherwise
117+
// keepalive: true,
117118
})
118119
this.version = metadata.version
119120

0 commit comments

Comments
 (0)