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

Re-use single http client / connection pool #69

Merged
merged 2 commits into from
Jan 6, 2024

Conversation

alexheretic
Copy link
Contributor

For personal access token use, current code builds a new reqwest::Client for each http call. This prevents connection pooling, so this PR switches to use a single Client and set headers on requests when necessary.

After testing it fetch latencies were unchanged, I guess connection pooling isn't a problem for this use case?

I think it's probably still worth merging as, imo, the code is cleaner this way.

@w4 w4 merged commit d66a0fa into w4:main Jan 6, 2024
7 checks passed
@alexheretic alexheretic deleted the one-http-client branch January 6, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants