Skip to content

Commit

Permalink
redis-trib import: trap MIGRATE errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed May 12, 2014
1 parent 939c586 commit 715a6d3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/redis-trib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1023,8 +1023,15 @@ def import_cluster_cmd(argv,opt)
# 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
Expand Down

0 comments on commit 715a6d3

Please sign in to comment.