make memcache-usage configurable

pull/658/head
Philipp Tessenow 11 years ago
parent d7f763ac75
commit cb6a195aae
  1. 2
      Gemfile
  2. 3
      config/configuration.yml.example
  3. 6
      config/environments/development.rb
  4. 4
      config/environments/production.rb
  5. 6
      config/initializers/session_store.rb
  6. 2
      lib/open_project/configuration.rb

@ -81,7 +81,7 @@ gem 'rack-protection'
gem 'syck', :platforms => [:ruby_20, :mingw_20], :require => false
group :production do
# we use dalli as standard memcache client remove this if you don't
# we use dalli as standard memcache client
# requires memcached 1.4+
# see https://github.com/mperham/dalli
gem 'dalli'

@ -131,6 +131,9 @@ default:
# see: https://websecuritytool.codeplex.com/wikipage?title=Checks#http-cache-control-header-no-store
# disable_browser_cache: true
# use memcache for performance, memcached must be installed
# rails_cache_store: :memcache
# Configuration of SCM executable command.
# Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe)
# On Windows, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.

@ -66,6 +66,10 @@ OpenProject::Application.configure do
# Send mails to browser window
config.action_mailer.delivery_method = :letter_opener
# we use per process memory for caching in development
# default to per process memory for caching in development
if OpenProject::Configuration['rails_cache_store'] == :memcache
config.cache_store = :dalli_store
else
config.cache_store = :memory_store
end
end

@ -71,8 +71,10 @@ OpenProject::Application.configure do
# Use a different logger for distributed setups
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
# rails defaults to :file_store, use :dalli when :memcaches is configured in configuration.yml
if OpenProject::Configuration['rails_cache_store'] == :memcache
config.cache_store = :dalli_store
end
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

@ -28,8 +28,4 @@
# Be sure to restart your server when you modify this file.
if Rails.env == 'production'
OpenProject::Application.config.session_store ActionDispatch::Session::CacheStore
else
OpenProject::Application.config.session_store :cookie_store, :key => '_open_project_session'
end
OpenProject::Application.config.session_store ActionDispatch::Session::CacheStore

@ -40,6 +40,8 @@ module OpenProject
'scm_git_command' => nil,
'scm_subversion_command' => nil,
'disable_browser_cache' => true,
# default cache_store is :file_store in production and :memory_store in development
'rails_cache_store' => :default,
# email configuration
'email_delivery_method' => nil,

Loading…
Cancel
Save