Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable keepAlive for HTTP requests #1534

Merged
merged 4 commits into from
Feb 5, 2025
Merged

fix: enable keepAlive for HTTP requests #1534

merged 4 commits into from
Feb 5, 2025

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 review from a team as code owners 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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants