Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal committed Nov 19, 2024
1 parent f3b3b39 commit 6255e4a
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions lib/redis_client/cluster/pub_sub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,21 @@ def next_event(timeout = nil) # rubocop:disable Metrics/AbcSize, Metrics/Cycloma

private

def _call(command)
case command.first
when 'subscribe', 'psubscribe', 'ssubscribe' then call_to_single_state(command)
when 'unsubscribe', 'punsubscribe' then call_to_all_states(command)
when 'sunsubscribe' then call_for_sharded_states(command)
else call_to_single_state(command)
def _call(command) # rubocop:disable Metrics/AbcSize
if command.first.casecmp('subscribe').zero?
call_to_single_state(command)
elsif command.first.casecmp('psubscribe').zero?
call_to_single_state(command)
elsif command.first.casecmp('ssubscribe').zero?
call_to_single_state(command)
elsif command.first.casecmp('unsubscribe').zero?
call_to_all_states(command)
elsif command.first.casecmp('punsubscribe').zero?
call_to_all_states(command)
elsif command.first.casecmp('sunsubscribe').zero?
call_for_sharded_states(command)
else
call_to_single_state(command)
end
end

Expand Down

0 comments on commit 6255e4a

Please sign in to comment.