lib/redis.rb in redis-3.0.3 vs lib/redis.rb in redis-3.0.4
- old
+ new
@@ -522,11 +522,11 @@
store = options[:store]
args.concat(["STORE", store]) if store
synchronize do |client|
client.call([:sort, key] + args) do |reply|
- if get.size > 1
+ if get.size > 1 && !store
if reply
reply.each_slice(get.size).to_a
end
else
reply
@@ -1992,20 +1992,22 @@
#
# @see #unwatch
# @see #multi
def watch(*keys)
synchronize do |client|
- client.call([:watch] + keys)
+ res = client.call([:watch] + keys)
if block_given?
begin
yield(self)
rescue ConnectionError
raise
rescue StandardError
unwatch
raise
end
+ else
+ res
end
end
end
# Forget about all watched keys.