lib/dashing/configuration.rb in dashing-rails-2.3.1 vs lib/dashing/configuration.rb in dashing-rails-2.3.2

- old
+ new

@@ -4,11 +4,11 @@ module Dashing class Configuration attr_reader :redis - attr_accessor :redis_host, :redis_port, :redis_password, :redis_namespace + attr_accessor :redis_host, :redis_port, :redis_password, :redis_namespace, :redis_timeout attr_accessor :auth_token, :devise_allowed_models attr_accessor :jobs_path attr_accessor :default_dashboard, :dashboards_views_path, :dashboard_layout_path attr_accessor :widgets_views_path, :widgets_js_path, :widgets_css_path attr_accessor :engine_path, :scheduler @@ -20,10 +20,11 @@ # Redis @redis_host = '127.0.0.1' @redis_port = '6379' @redis_password = nil @redis_namespace = 'dashing_events' + @redis_timeout = 3 # Authorization @auth_token = nil @devise_allowed_models = [] @@ -40,10 +41,10 @@ @widgets_js_path = 'app/assets/javascripts/dashing' @widgets_css_path = 'app/assets/stylesheets/dashing' end def redis - @redis ||= ::ConnectionPool::Wrapper.new(size: request_thread_count, timeout: 3) { new_redis_connection } + @redis ||= ::ConnectionPool::Wrapper.new(size: request_thread_count, timeout: redis_timeout) { new_redis_connection } end def new_redis_connection ::Redis.new(host: redis_host, port: redis_port, password: redis_password) end