From 45568bbb1214084f5be6304d0b49afe4a8722c3a Mon Sep 17 00:00:00 2001 From: f Date: Mon, 29 Jul 2019 15:51:09 -0300 Subject: [PATCH] usar redis como cache --- .rubocop.yml | 1 + config/environments/development.rb | 24 ++++++++++++++---------- config/environments/production.rb | 6 +++--- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 8df0329..8b614a3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -36,6 +36,7 @@ Metrics/MethodLength: Metrics/BlockLength: Exclude: + - 'config/environments/development.rb' - 'config/environments/production.rb' - 'config/initializers/devise.rb' - 'db/schema.rb' diff --git a/config/environments/development.rb b/config/environments/development.rb index ad1c4d9..68c0679 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,11 +1,13 @@ # frozen_string_literal: true Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. + # Settings specified here will take precedence over those in + # config/application.rb. - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. + # In the development environment your application's code is reloaded + # on every request. This slows down response time but is perfect for + # development since you don't have to restart the web server when you + # make code changes. config.cache_classes = false # Do not eager load code on boot. @@ -18,7 +20,7 @@ Rails.application.configure do if Rails.root.join('tmp/caching-dev.txt').exist? config.action_controller.perform_caching = true - config.cache_store = :memory_store + config.cache_store = :redis_cache_store config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}" } @@ -39,8 +41,8 @@ Rails.application.configure do # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load - # Debug mode disables concatenation and preprocessing of assets. - # This option may cause significant delays in view rendering with a large + # Debug mode disables concatenation and preprocessing of assets. This + # option may cause significant delays in view rendering with a large # number of complex assets. config.assets.debug = true @@ -50,8 +52,9 @@ Rails.application.configure do # Raises error for missing translations # config.action_view.raise_on_missing_translations = true - # Use an evented file watcher to asynchronously detect changes in source code, - # routes, locales, etc. This feature depends on the listen gem. + # Use an evented file watcher to asynchronously detect changes in + # source code, routes, locales, etc. This feature depends on the + # listen gem. config.file_watcher = ActiveSupport::EventedFileUpdateChecker CarrierWave.configure do |config| @@ -63,5 +66,6 @@ Rails.application.configure do config.action_mailer.perform_caching = false config.action_mailer.delivery_method = :letter_opener config.action_mailer.perform_deliveries = true - config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } + config.action_mailer.default_url_options = { host: 'localhost', + port: 3000 } end diff --git a/config/environments/production.rb b/config/environments/production.rb index 12687e0..dcdd555 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -56,12 +56,12 @@ Rails.application.configure do config.log_tags = [:request_id] # Use a different cache store in production. - # config.cache_store = :mem_cache_store + config.cache_store = :redis_cache_store # Use a real queuing backend for Active Job (and separate queues per # environment) - # config.active_job.queue_adapter = :resque - # config.active_job.queue_name_prefix = "sutty_#{Rails.env}" + config.active_job.queue_adapter = :sidekiq + config.active_job.queue_name_prefix = "sutty_#{Rails.env}" config.action_mailer.perform_caching = false # Ignore bad email addresses and do not raise email delivery errors.