Skip to content

Commit 3f3652a

Browse files
authored
fix: handle redirection for transactions (#280)
1 parent 6e54db6 commit 3f3652a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/class_diagrams_redis_cluster_client.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ classDiagram
108108
+execute()
109109
}
110110
111+
class RedisClient_Cluster_Transaction {
112+
+call()
113+
+call_v()
114+
+call_once()
115+
+call_once_v()
116+
+execute()
117+
}
118+
111119
class RedisClient_Cluster_PubSub {
112120
+call()
113121
+call_v()
@@ -127,10 +135,12 @@ classDiagram
127135
RedisClient_ClusterConfig ..> RedisClient_Cluster : new
128136
129137
RedisClient_Cluster ..> RedisClient_Cluster_Pipeline : new
138+
RedisClient_Cluster ..> RedisClient_Cluster_Transaction : new
130139
RedisClient_Cluster ..> RedisClient_Cluster_PubSub : new
131140
RedisClient_Cluster ..> RedisClient_Cluster_Router : new
132141
133142
RedisClient_Cluster_Pipeline ..> RedisClient_Cluster_Router : use
143+
RedisClient_Cluster_Transaction ..> RedisClient_Cluster_Router : use
134144
RedisClient_Cluster_PubSub ..> RedisClient_Cluster_Router : use
135145
136146
RedisClient_Cluster_Router ..> RedisClient_Cluster_Node : new

lib/redis_client/cluster/transaction.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def execute(watch: nil, &block)
3737
yield self
3838
raise ArgumentError, 'empty transaction' if @node_key.nil?
3939

40-
@router.find_node(@node_key).multi(watch: watch, &block)
40+
node = @router.find_node(@node_key)
41+
@router.try_delegate(node, :multi, watch: watch, &block)
4142
end
4243

4344
private

0 commit comments

Comments
 (0)