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

refactor: used a common http client for all the requests #1194

Conversation

Yashk767
Copy link
Contributor

@Yashk767 Yashk767 commented Mar 19, 2024

Description

Used a common http client to avoid opening a new connection on every client.Do() call for every API.
A single http client makes the node to reuse the existing connections from connection pool.

Fixes #1197 , https://linear.app/interstellar-research/issue/RAZ-771

How Has This Been Tested?

Ran a node on local and staging environment with 5 min epoch time.

@ashish10677
Copy link
Member

@Yashk767 why are the tests failing?

@SkandaBhat SkandaBhat self-requested a review March 21, 2024 12:03
"time"
)

var httpClient *http.Client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DO not use global variables. Use a struct and implement methods. cc: @ashish10677

@SkandaBhat
Copy link
Contributor

Closing this. Please reopen after updating.

@SkandaBhat SkandaBhat closed this Apr 8, 2024
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.

3 participants