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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants