method
retrieve_pool_options
v7.1.3.4 -
Show latest stable
-
0 notes -
Class: ActiveSupport::Cache::Store
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0
- 3.0.9
- 3.1.0
- 3.2.1
- 3.2.8
- 3.2.13
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3 (0)
- 6.0.0 (0)
- 6.1.3.1 (0)
- 6.1.7.7 (0)
- 7.0.0 (0)
- 7.1.3.2 (0)
- 7.1.3.4 (0)
- What's this?
retrieve_pool_options(options)
private
Hide source
# File activesupport/lib/active_support/cache.rb, line 206 def retrieve_pool_options(options) if options.key?(:pool) pool_options = options.delete(:pool) elsif options.key?(:pool_size) || options.key?(:pool_timeout) pool_options = {} if options.key?(:pool_size) ActiveSupport.deprecator.warn(<<~MSG) Using :pool_size is deprecated and will be removed in Rails 7.2. Use `pool: { size: #{options[:pool_size].inspect} }` instead. MSG pool_options[:size] = options.delete(:pool_size) end if options.key?(:pool_timeout) ActiveSupport.deprecator.warn(<<~MSG) Using :pool_timeout is deprecated and will be removed in Rails 7.2. Use `pool: { timeout: #{options[:pool_timeout].inspect} }` instead. MSG pool_options[:timeout] = options.delete(:pool_timeout) end else pool_options = true end case pool_options when false, nil return false when true pool_options = DEFAULT_POOL_OPTIONS when Hash pool_options[:size] = Integer(pool_options[:size]) if pool_options.key?(:size) pool_options[:timeout] = Float(pool_options[:timeout]) if pool_options.key?(:timeout) pool_options = DEFAULT_POOL_OPTIONS.merge(pool_options) else raise TypeError, "Invalid :pool argument, expected Hash, got: #{pool_options.inspect}" end pool_options unless pool_options.empty? end