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

Reuse reqwest client across codebase #990

Closed
wants to merge 2 commits into from
Closed

Conversation

benthecarman
Copy link
Collaborator

@benthecarman benthecarman commented Jan 25, 2024

Closes #973

If we create new reqwest clients everywhere we need to create new connections and redo TLS verification for every new client. This makes it so we reuse one across the codebase for pretty much everywhere. Should make things more efficient .

As part of this, moved the bitcoin price code to mutiny wallet instead of the node manager, made more sense here and made the refactor easier.

@@ -24,7 +24,7 @@ struct CustomClaims {

pub struct MutinyAuthClient {
pub auth: AuthManager,
lnurl_client: Arc<LnUrlClient>,
pub lnurl_client: Arc<LnUrlClient>,
Copy link
Contributor

Choose a reason for hiding this comment

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

nack

not only should you not be reusing an internal client to MutinyAuth for this, but you should be using an internal client to an internal lnurl client library for this either. either have some generic http client that everyone uses at the top level or let things be as is.

@benthecarman
Copy link
Collaborator Author

Turns out this doesn't matter for wasm, the browser handles it all for you. Will still leave the issue open in case someone wants to pick it up for mutiny-server or whatever

@benthecarman benthecarman deleted the reqwest-cleanup branch February 6, 2024 10:46
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.

Unify reqwest clients across codebase
2 participants