Skip to content

Commit

Permalink
Merge pull request #134 from dhruvCW/handle_string_role
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot authored Aug 16, 2023
2 parents 5fbcbe7 + 4aa9519 commit 4388804
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/redis_client/sentinel_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class SentinelConfig
attr_reader :name

def initialize(sentinels:, role: :master, name: nil, url: nil, **client_config)
unless %i(master replica slave).include?(role)
unless %i(master replica slave).include?(role.to_sym)
raise ArgumentError, "Expected role to be either :master or :replica, got: #{role.inspect}"
end

Expand Down Expand Up @@ -43,7 +43,7 @@ def initialize(sentinels:, role: :master, name: nil, url: nil, **client_config)
end

@sentinels = {}.compare_by_identity
@role = role
@role = role.to_sym
@mutex = Mutex.new
@config = nil

Expand Down

0 comments on commit 4388804

Please sign in to comment.