Skip to content

Commit

Permalink
Redis config: commit suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
jlledom committed Oct 12, 2023
1 parent 2398957 commit d0ef09f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/lib/three_scale/redis_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def initialize(redis_config = {})
raw_config = (redis_config || {}).symbolize_keys
sentinels = raw_config.delete(:sentinels).presence
raw_config.delete_if { |key, value| value.blank? }
set_pool_size(raw_config)
raw_config[:size] ||= raw_config.delete(:pool_size) if raw_config.key?(:pool_size)

@config = ActiveSupport::OrderedOptions.new.merge(raw_config)
config.sentinels = parse_sentinels(sentinels) if sentinels
Expand Down Expand Up @@ -56,11 +56,5 @@ def parse_sentinels(sentinels)
parsed_sentinel
end
end

def set_pool_size(config)
return if config[:size].present?

config[:size] = config.delete(:pool_size) if config.key?(:pool_size)
end
end
end

0 comments on commit d0ef09f

Please sign in to comment.