From eb4538ddfa494036afaccb8fea553d6c7dc51fdd Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 14 Sep 2016 19:33:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BF=BD=E7=95=A5production.?= =?UTF-8?q?rb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + config/environments/production.rb.template | 38 ++++++++++++++++++++++ config/environments/production.rb.test | 38 ++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 config/environments/production.rb.template create mode 100644 config/environments/production.rb.test diff --git a/.gitignore b/.gitignore index 8a40f3ca7..40ddd80db 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ public/javascripts/wechat/node_modules/ .access_token tmux*.log config/wechat.yml +config/environments/production.rb diff --git a/config/environments/production.rb.template b/config/environments/production.rb.template new file mode 100644 index 000000000..e76e2d1d7 --- /dev/null +++ b/config/environments/production.rb.template @@ -0,0 +1,38 @@ +# Settings specified here will take precedence over those in config/application.rb +RedmineApp::Application.configure do + # The production environment is meant for finished, "live" apps. + # Code is not reloaded between requests + config.cache_classes = true + + ##### + # Customize the default logger (http://ruby-doc.org/core/classes/Logger.html) + # + # Use a different logger for distributed setups + # config.logger = SyslogLogger.new + # + # Rotate logs bigger than 1MB, keeps no more than 7 rotated logs around. + # When setting a new Logger, make sure to set it's log level too. + # + # config.logger = Logger.new(config.log_path, 7, 1048576) + # config.logger.level = Logger::INFO + + # Full error reports are disabled and caching is turned on + # config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly + config.action_controller.perform_caching = true + + # to additional_environment.rb + # config.cache_store = :file_store, "#{Rails.root }/files/cache_store/" + # config.cache_store = :redis_store, 'redis://localhost:6379/0/cache', { expires_in: 90.minutes } + # + config.cache_store = :redis_store, 'redis://10.9.52.157:6379/0/cache', { expires_in: 90.minutes } + # Enable serving of images, stylesheets, and javascripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" + + # Disable delivery errors if you bad email addresses should just be ignored + config.action_mailer.raise_delivery_errors = false + + # No email in production log + config.action_mailer.logger = nil + + config.active_support.deprecation = :log +end diff --git a/config/environments/production.rb.test b/config/environments/production.rb.test new file mode 100644 index 000000000..7602ccbd9 --- /dev/null +++ b/config/environments/production.rb.test @@ -0,0 +1,38 @@ +# Settings specified here will take precedence over those in config/application.rb +RedmineApp::Application.configure do + # The production environment is meant for finished, "live" apps. + # Code is not reloaded between requests + config.cache_classes = true + + ##### + # Customize the default logger (http://ruby-doc.org/core/classes/Logger.html) + # + # Use a different logger for distributed setups + # config.logger = SyslogLogger.new + # + # Rotate logs bigger than 1MB, keeps no more than 7 rotated logs around. + # When setting a new Logger, make sure to set it's log level too. + # + # config.logger = Logger.new(config.log_path, 7, 1048576) + # config.logger.level = Logger::INFO + + # Full error reports are disabled and caching is turned on + # config.logger = Logger.new('log/production.log', 'daily',1048576) # daily, weekly or monthly + config.action_controller.perform_caching = true + + # to additional_environment.rb + # config.cache_store = :file_store, "#{Rails.root }/files/cache_store/" + # config.cache_store = :redis_store, 'redis://localhost:6379/0/cache', { expires_in: 90.minutes } + # + config.cache_store = :redis_store, 'redis://192.168.80.122:6379/0/cache', { expires_in: 90.minutes } + # Enable serving of images, stylesheets, and javascripts from an asset server + # config.action_controller.asset_host = "http://assets.example.com" + + # Disable delivery errors if you bad email addresses should just be ignored + config.action_mailer.raise_delivery_errors = false + + # No email in production log + config.action_mailer.logger = nil + + config.active_support.deprecation = :log +end