From 18454ba3738729752522b63aeb2defb6cbfad2e5 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Thu, 14 Mar 2024 14:01:39 +0900 Subject: [PATCH] fix: fix a dedicated method for watch to be same manner as the multi method --- lib/redis_client/cluster/router.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/redis_client/cluster/router.rb b/lib/redis_client/cluster/router.rb index 94963d4..5583e48 100644 --- a/lib/redis_client/cluster/router.rb +++ b/lib/redis_client/cluster/router.rb @@ -315,9 +315,9 @@ def send_pubsub_command(method, command, args, &block) # rubocop:disable Metrics def send_watch_command(command) raise ::RedisClient::Cluster::Transaction::ConsistencyError, 'A block required. And you need to use the block argument as a client for the transaction.' unless block_given? - ::RedisClient::Cluster::OptimisticLocking.new(self).watch(command[1..]) do |c, slot| + ::RedisClient::Cluster::OptimisticLocking.new(self).watch(command[1..]) do |c, slot, asking| transaction = ::RedisClient::Cluster::Transaction.new( - self, @command_builder, node: c, slot: slot + self, @command_builder, node: c, slot: slot, asking: asking ) yield transaction transaction.execute