diff options
author | Utkarsh Gupta <utkarshgupta137@gmail.com> | 2022-07-27 16:35:35 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-27 14:05:35 +0300 |
commit | f665bd306dc843cec3e8fa01d6f4061385d1812e (patch) | |
tree | dcbc11c7f5474a08f876fa265fdf069480b7e3d2 /redis/cluster.py | |
parent | 3c4d96bcfa1758a2ffd7b1d913166f6f7ca107a5 (diff) | |
download | redis-py-f665bd306dc843cec3e8fa01d6f4061385d1812e.tar.gz |
async_cluster: fix max_connections/ssl & improve args (#2217)
* async_cluster: fix max_connections/ssl & improve args
- set proper connection_class if ssl = True
- pass max_connections/connection_class to ClusterNode
- recreate startup_nodes to properly initialize
- pass parser_class to Connection instead of changing it in on_connect
- only pass redis_connect_func if read_from_replicas = True
- add connection_error_retry_attempts parameter
- skip is_connected check in acquire_connection as it is already checked in send_packed_command
BREAKING:
- RedisCluster args except host & port are kw-only now
- RedisCluster will no longer accept unknown arguments
- RedisCluster will no longer accept url as an argument. Use RedisCluster.from_url
- RedisCluster.require_full_coverage defaults to True
- ClusterNode args except host, port, & server_type are kw-only now
* async_cluster: remove kw-only requirement from client
Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
Diffstat (limited to 'redis/cluster.py')
-rw-r--r-- | redis/cluster.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/redis/cluster.py b/redis/cluster.py index b2d4f3b..b05cf30 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -5,7 +5,7 @@ import sys import threading import time from collections import OrderedDict -from typing import Any, Callable, Dict, Tuple +from typing import Any, Callable, Dict, Tuple, Union from redis.client import CaseInsensitiveDict, PubSub, Redis, parse_scan from redis.commands import READ_COMMANDS, CommandsParser, RedisClusterCommands @@ -38,7 +38,7 @@ from redis.utils import ( ) -def get_node_name(host: str, port: int) -> str: +def get_node_name(host: str, port: Union[str, int]) -> str: return f"{host}:{port}" |