Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
715a6d3a
Commit
715a6d3a
authored
May 12, 2014
by
antirez
Browse files
redis-trib import: trap MIGRATE errors.
parent
939c586e
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
715a6d3a
...
@@ -1023,8 +1023,15 @@ class RedisTrib
...
@@ -1023,8 +1023,15 @@ class RedisTrib
# Migrate keys using the MIGRATE command.
# Migrate keys using the MIGRATE command.
slot
=
key_to_slot
(
k
)
slot
=
key_to_slot
(
k
)
target
=
slots
[
slot
]
target
=
slots
[
slot
]
puts
"Migrating
#{
k
}
to
#{
target
}
"
print
"Migrating
#{
k
}
to
#{
target
}
: "
STDOUT
.
flush
begin
source
.
client
.
call
([
"migrate"
,
target
.
info
[
:host
],
target
.
info
[
:port
],
k
,
0
,
15000
])
source
.
client
.
call
([
"migrate"
,
target
.
info
[
:host
],
target
.
info
[
:port
],
k
,
0
,
15000
])
rescue
=>
e
puts
e
else
puts
"OK"
end
}
}
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment