Remove client retries and move more code to envio package - #329
Merged
Conversation
JonoPrest
commented
Nov 8, 2024
Comment on lines
+426
to
+433
|
|
||
| let make = (~url, ~bearerToken: option<string>, ~httpReqTimeoutMillis, ~maxNumRetries) => | ||
| new({ | ||
| url, | ||
| enableChecksumAddresses: true, | ||
| bearerToken: Env.envioApiToken->Belt.Option.getWithDefault(defaultToken), | ||
| httpReqTimeoutMillis: Env.hyperSyncClientTimeoutMillis->Belt.Option.getWithDefault(120_000), | ||
| bearerToken: bearerToken->Belt.Option.getWithDefault(defaultToken), | ||
| httpReqTimeoutMillis, | ||
| maxNumRetries, |
Collaborator
Author
There was a problem hiding this comment.
The constructor of HyperSyncClient now takes arguments explicitly
JonoPrest
commented
Nov 8, 2024
Comment on lines
+85
to
+90
| let newClient = HyperSyncClient.make( | ||
| ~url, | ||
| ~bearerToken=Env.envioApiToken, | ||
| ~maxNumRetries=Env.hyperSyncClientMaxRetries, | ||
| ~httpReqTimeoutMillis=Env.hyperSyncClientTimeoutMillis, | ||
| ) |
Collaborator
Author
There was a problem hiding this comment.
client instantiated with the environment variables.
JonoPrest
commented
Nov 8, 2024
Comment on lines
+32
to
+37
| /** | ||
| This is the number of retries that the binary client makes before rejecting the promise with an error | ||
| Default is 0 so that the indexer can handle retries internally | ||
| */ | ||
| let hyperSyncClientMaxRetries = | ||
| envSafe->EnvSafe.get("ENVIO_HYPERSYNC_CLIENT_MAX_RETRIES", S.int, ~fallback=0) |
Collaborator
Author
There was a problem hiding this comment.
The client by default sets this to 12, I want to avoid all retries by the client so we can get the error response and handle the retry on the indexer. That way trace of where it could freeze would be more explicit
JonoPrest
force-pushed
the
jp/remove-client-retries
branch
from
November 8, 2024 16:01
0b58019 to
5672f9f
Compare
JonoPrest
force-pushed
the
jp/remove-client-retries
branch
from
November 8, 2024 16:16
5672f9f to
ff021ed
Compare
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.
No description provided.