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

Support string slot values in CLUSTER SHARD response #56

Merged
merged 2 commits into from
Feb 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/nebulex_redis_adapter/redis_cluster/config_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ defmodule NebulexRedisAdapter.RedisCluster.ConfigManager do
[{start, stop, host, port} | acc]
end)
|> Enum.map(fn {start, stop, host, port} ->
{start, stop, maybe_override_host(host, config_endpoint, override?), port}
{maybe_convert_to_integer(start), maybe_convert_to_integer(stop),
maybe_override_host(host, config_endpoint, override?), port}
end)
end

Expand Down Expand Up @@ -318,4 +319,7 @@ defmodule NebulexRedisAdapter.RedisCluster.ConfigManager do
end

# coveralls-ignore-stop

defp maybe_convert_to_integer(value) when is_binary(value), do: String.to_integer(value)
defp maybe_convert_to_integer(value), do: value
Copy link
Owner

Choose a reason for hiding this comment

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

LGTM, but let's move the # coveralls-ignore-stop above to skip these new lines (or you can also add a test, but I think it is just a simple thing).

end
Loading