summaryrefslogtreecommitdiff
path: root/src/redis-trib.rb
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-05-12 10:36:33 +0200
committerantirez <antirez@gmail.com>2014-05-12 10:36:33 +0200
commit715a6d3a7824b7c1cd1902be800b5aa8b638aa76 (patch)
tree73f06d0da57b260ae9cff29f2daf4bf342fa97e5 /src/redis-trib.rb
parent939c586ef74bbfbaa5fa88b270734a9332d7ca63 (diff)
downloadredis-715a6d3a7824b7c1cd1902be800b5aa8b638aa76.tar.gz
redis-trib import: trap MIGRATE errors.
Diffstat (limited to 'src/redis-trib.rb')
-rwxr-xr-xsrc/redis-trib.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/redis-trib.rb b/src/redis-trib.rb
index b6f6aba39..92663eda8 100755
--- a/src/redis-trib.rb
+++ b/src/redis-trib.rb
@@ -1023,8 +1023,15 @@ class RedisTrib
# Migrate keys using the MIGRATE command.
slot = key_to_slot(k)
target = slots[slot]
- puts "Migrating #{k} to #{target}"
- source.client.call(["migrate",target.info[:host],target.info[:port],k,0,15000])
+ print "Migrating #{k} to #{target}: "
+ STDOUT.flush
+ begin
+ source.client.call(["migrate",target.info[:host],target.info[:port],k,0,15000])
+ rescue => e
+ puts e
+ else
+ puts "OK"
+ end
}
end
end