Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

fix: enable keepAlive for HTTP requests#1534

Merged
sofisl merged 4 commits intomainfrom
fetch-keepalive
Feb 5, 2025
Merged

fix: enable keepAlive for HTTP requests#1534
sofisl merged 4 commits intomainfrom
fetch-keepalive

Conversation

@alexander-fenster
Copy link
Contributor

As described in https://github.com/node-fetch/node-fetch#custom-agent, the keepalive option is not enabled by default until Node.js v19, which makes HTTP requests reconnect for each request.

In this PR I will add Node.js HTTP/HTTPS agent initialization as suggested at the link above; I'm doing it in this somewhat hacky way instead of regular import * as https from 'https' to make sure the non-Node scenarios are not broken by this.

Let's see if it helps!

@alexander-fenster alexander-fenster requested a review from a team as a code owner January 11, 2024 20:12
@alexander-fenster alexander-fenster requested a review from a team January 11, 2024 20:12
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label Jan 11, 2024
@alexander-fenster alexander-fenster force-pushed the fetch-keepalive branch 2 times, most recently from 4a07184 to f29445b Compare January 11, 2024 20:23
@alexander-fenster alexander-fenster added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 18, 2024
@sofisl sofisl removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Feb 4, 2025
@sofisl sofisl requested a review from a team as a code owner February 4, 2025 20:46
@sofisl sofisl added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 5, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 5, 2025
@sofisl sofisl merged commit a706d5a into main Feb 5, 2025
26 of 27 checks passed
@sofisl sofisl deleted the fetch-keepalive branch February 5, 2025 00:58
@release-please release-please bot mentioned this pull request Feb 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants