Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal committed Nov 17, 2024
1 parent 1199747 commit 6e6c228
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions lib/redis_client/cluster/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Command
Detail = Struct.new(
'RedisCommand',
:first_key_position,
:last_key_position,
:key_step,
:write?,
:readonly?,
Expand Down Expand Up @@ -54,7 +53,6 @@ def parse_command_reply(rows)

acc[row[0].downcase] = ::RedisClient::Cluster::Command::Detail.new(
first_key_position: row[3],
last_key_position: row[4],
key_step: row[5],
write?: row[2].include?('write'),
readonly?: row[2].include?('readonly')
Expand Down
6 changes: 3 additions & 3 deletions test/redis_client/cluster/test_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ def test_parse_command_reply
['set', -3, Set['write', 'denyoom', 'movablekeys'], 1, -1, 2, Set['@write', '@string', '@slow'], Set[], Set[], Set[]]
],
want: {
'get' => { first_key_position: 1, last_key_position: -1, key_step: 1, write?: false, readonly?: true },
'set' => { first_key_position: 1, last_key_position: -1, key_step: 2, write?: true, readonly?: false }
'get' => { first_key_position: 1, key_step: 1, write?: false, readonly?: true },
'set' => { first_key_position: 1, key_step: 2, write?: true, readonly?: false }
}
},
{
rows: [
['GET', 2, Set['readonly', 'fast'], 1, -1, 1, Set['@read', '@string', '@fast'], Set[], Set[], Set[]]
],
want: {
'get' => { first_key_position: 1, last_key_position: -1, key_step: 1, write?: false, readonly?: true }
'get' => { first_key_position: 1, key_step: 1, write?: false, readonly?: true }
}
},
{ rows: [[]], want: {} },
Expand Down

0 comments on commit 6e6c228

Please sign in to comment.