Skip to content

redis: Fix types of some options #1372

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

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

kajinamit
Copy link
Contributor

@kajinamit kajinamit commented Feb 14, 2024

The socket_keepalive option in RedisClient is not an integer but a boolean. Also the healthcheck_interval option can accept not only integers but also float values. This fixes the types to parse these options accordingly.

Note this change still keeps support for socket_keepalive=1 or socket_keepalive=0 , but would remove support for the other integer values such as 2 or -1.

The socket_keepalive option in RedisClient is not an integer but
a boolean. Also the healthcheck_interval option can accept not only
integers but also float values. This fixes the types to parse these
options accordingly.

Note this change still keeps support for socket_keepalive=1 or
socket_keepalive=0 , but would remove support for the other integer
values such as 2 or -1.
])

#: Client arguments that are expected to be float convertible.
CLIENT_FLOAT_ARGS = frozenset([
'socket_timeout',
'health_check_interval',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I think it is explained in the PR comment as well as the commit message ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. I missed the second sentence 😑. Sorry for that.

@tobias-urdin tobias-urdin merged commit 4e9f6c1 into gnocchixyz:master Feb 29, 2024
@kajinamit kajinamit deleted the redis-opt-type-fix branch March 4, 2024 10:44
@tobias-urdin
Copy link
Contributor

@Mergifyio backport stable/4.6

Copy link
Contributor

mergify bot commented Aug 20, 2024

backport stable/4.6

✅ Backports have been created

tobias-urdin added a commit that referenced this pull request Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants