-
Notifications
You must be signed in to change notification settings - Fork 113
fix: make service discovery use a single client #2621
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: make service discovery use a single client #2621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
client
field toServiceDiscovery
struct 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
Ok(client | ||
async fn fetch_inner(&self) -> Result<ProvisionDatacentersGetServersResponse, reqwest::Error> { | ||
Ok(self | ||
.client | ||
.get(self.fetch_endpoint.clone()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: clone() on Url for each request is unnecessary since Client already handles concurrent requests safely. Use &self.fetch_endpoint
.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
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 |
3abbbbc
to
a246cb7
Compare
5d622b5
to
0e85267
Compare
Merge activity
|
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
Changes