# frozen_string_literal: true module NeetoCommonsBackend module Initializers class << self def cache_store(config) if Rails.application.secrets.redis_cache_url.present? config.cache_store = :redis_cache_store, { url: ENV[Rails.application.secrets.redis_cache_url], connect_timeout: 30, # Defaults to 20 seconds read_timeout: 0.4, # Defaults to 1 second write_timeout: 0.4, # Defaults to 1 second reconnect_attempts: 1, # Defaults to 0 ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE }, error_handler: lambda { |method:, returning:, exception:| # Report errors to Honeybadger Honeybadger.notify(exception, context: { method:, returning: }) } } end end end end end