fix: make service discovery use a single client#2621
Closed
MasterPtato wants to merge 1 commit into06-16-fix_add_cache_to_server_list_queriesfrom
Closed
fix: make service discovery use a single client#2621MasterPtato wants to merge 1 commit into06-16-fix_add_cache_to_server_list_queriesfrom
MasterPtato wants to merge 1 commit into06-16-fix_add_cache_to_server_list_queriesfrom
Conversation
Contributor
Author
There was a problem hiding this comment.
PR Summary
Optimizes service discovery by implementing connection pooling through a single reusable HTTP client instead of creating new clients per request in packages/common/service-discovery/src/lib.rs.
- Adds a persistent
clientfield toServiceDiscoverystruct for better connection reuse - Removes redundant client creation from request methods, improving performance
- Centralizes HTTP client configuration and lifecycle management in the constructor
1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
| async fn fetch_inner(&self) -> Result<ProvisionDatacentersGetServersResponse, reqwest::Error> { | ||
| Ok(self | ||
| .client | ||
| .get(self.fetch_endpoint.clone()) |
There was a problem hiding this comment.
logic: clone() on Url for each request is unnecessary since Client already handles concurrent requests safely. Use &self.fetch_endpoint
Suggested change
| .get(self.fetch_endpoint.clone()) | |
| .get(&self.fetch_endpoint) |
Deploying rivet with
|
| Latest commit: |
3abbbbc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0ea1e4de.rivet.pages.dev |
| Branch Preview URL: | https://graphite-base-2475.rivet.pages.dev |
283deec to
5d622b5
Compare
24b7fef to
3abbbbc
Compare
This was referenced Jun 17, 2025
Deploying rivet-hub with
|
| Latest commit: |
3abbbbc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7e11980a.rivet-hub-7jb.pages.dev |
| Branch Preview URL: | https://graphite-base-2475.rivet-hub-7jb.pages.dev |
This was referenced Jun 19, 2025
3abbbbc to
a246cb7
Compare
5d622b5 to
0e85267
Compare
Contributor
Merge activity
|
graphite-app bot
pushed a commit
that referenced
this pull request
Jun 20, 2025
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changes