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

Add max_delay for every reconnect #1192

Conversation

tonynguyen-sotatek
Copy link
Contributor

No description provided.

@@ -211,6 +211,9 @@ pub struct ConnectionInfo {

/// A boxed connection address for where to connect to.
pub redis: RedisConnectionInfo,

/// In case of reconnection issues, the manager will retry reconnection
pub retry_strategy: Option<RetryStrategyInfo>,
Copy link
Contributor

Choose a reason for hiding this comment

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

this isn't the place for this - if only one connection type uses this, it should be in that type's config, not here.

@@ -123,12 +134,14 @@ impl ConnectionManager {
exponent_base: u64,
factor: u64,
number_of_retries: usize,
max_delay: Option<u64>,
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of adding another field to the function, which is a breaking change, you should add another function taking that field.
and in order to limit the number of functions, please follow the example in this PR - that is, add a configuration object, and a function using that configuration object, so that new fields won't break users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, i will update code with new PR

@nihohit
Copy link
Contributor

nihohit commented May 24, 2024

as a rule of thumb, PRs should come either with a description or an issue explaining what is the goal of the PR and justifying the design chosen in order to achieve this goal.

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.

None yet

2 participants