In certain cases puma does not set application root. Moved to set cache_store via config/application.rb.

This commit is contained in:
Martin Edenhofer 2016-03-16 11:11:00 +01:00
parent 292a31b6ef
commit 44a0eed6d8
3 changed files with 2 additions and 14 deletions

View file

@ -48,7 +48,7 @@ module Zammad
config.api_path = '/api/v1'
# define cache store
config.cache_store = :file_store, "tmp/cache_file_store_#{Rails.env}"
config.cache_store = :file_store, "#{Rails.root}/tmp/cache_file_store_#{Rails.env}"
# default preferences by role
config.preferences_default_by_role = {

View file

@ -54,9 +54,6 @@ Rails.application.configure do
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com'
@ -83,7 +80,4 @@ Rails.application.configure do
# format log
config.log_formatter = Logger::Formatter.new
# define cache store
config.cache_store = :file_store, 'tmp/cache_file_store_production'
end

View file

@ -10,8 +10,6 @@ delete a cache
def self.delete(key)
Rails.cache.delete(key.to_s)
rescue => e
Rails.logger.error "ERROR: Cache.delete #{e.message}"
end
=begin
@ -30,11 +28,7 @@ write a cache
if !params[:expires_in]
params[:expires_in] = 7.days
end
begin
Rails.cache.write(key.to_s, data, params)
rescue => e
Rails.logger.error "ERROR: Cache.write #{e.message}"
end
Rails.cache.write(key.to_s, data, params)
end
=begin