diff options
author | Dongkeun Lee <3315213+zakaf@users.noreply.github.com> | 2023-01-11 18:29:11 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-11 11:29:11 +0200 |
commit | bae6385c1b0097a1d85c7825604170477d193481 (patch) | |
tree | c9375cd81abe76b57b0d40526a4dd0564b521667 /redis/cluster.py | |
parent | 4a825bc76b668951923c57aaff1020c3892f8de2 (diff) | |
download | redis-py-bae6385c1b0097a1d85c7825604170477d193481.tar.gz |
allow replica to master promotion in nodes_cache (#2549)
Co-authored-by: zach.lee <zach.lee@sendbird.com>
Diffstat (limited to 'redis/cluster.py')
-rw-r--r-- | redis/cluster.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/redis/cluster.py b/redis/cluster.py index f115007..235d8f2 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -1437,6 +1437,8 @@ class NodesManager: if target_node is None or target_node.redis_connection is None: # create new cluster node for this cluster target_node = ClusterNode(host, port, role) + if target_node.server_type != role: + target_node.server_type = role return target_node |