In certain cases puma does not set application root. Moved to set cache_store via config/application.rb.
This commit is contained in:
parent
292a31b6ef
commit
44a0eed6d8
3 changed files with 2 additions and 14 deletions
|
@ -48,7 +48,7 @@ module Zammad
|
||||||
config.api_path = '/api/v1'
|
config.api_path = '/api/v1'
|
||||||
|
|
||||||
# define cache store
|
# 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
|
# default preferences by role
|
||||||
config.preferences_default_by_role = {
|
config.preferences_default_by_role = {
|
||||||
|
|
|
@ -54,9 +54,6 @@ Rails.application.configure do
|
||||||
# Use a different logger for distributed setups.
|
# Use a different logger for distributed setups.
|
||||||
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
# 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.
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||||
# config.action_controller.asset_host = 'http://assets.example.com'
|
# config.action_controller.asset_host = 'http://assets.example.com'
|
||||||
|
|
||||||
|
@ -83,7 +80,4 @@ Rails.application.configure do
|
||||||
# format log
|
# format log
|
||||||
config.log_formatter = Logger::Formatter.new
|
config.log_formatter = Logger::Formatter.new
|
||||||
|
|
||||||
# define cache store
|
|
||||||
config.cache_store = :file_store, 'tmp/cache_file_store_production'
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,8 +10,6 @@ delete a cache
|
||||||
|
|
||||||
def self.delete(key)
|
def self.delete(key)
|
||||||
Rails.cache.delete(key.to_s)
|
Rails.cache.delete(key.to_s)
|
||||||
rescue => e
|
|
||||||
Rails.logger.error "ERROR: Cache.delete #{e.message}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
|
@ -30,11 +28,7 @@ write a cache
|
||||||
if !params[:expires_in]
|
if !params[:expires_in]
|
||||||
params[:expires_in] = 7.days
|
params[:expires_in] = 7.days
|
||||||
end
|
end
|
||||||
begin
|
Rails.cache.write(key.to_s, data, params)
|
||||||
Rails.cache.write(key.to_s, data, params)
|
|
||||||
rescue => e
|
|
||||||
Rails.logger.error "ERROR: Cache.write #{e.message}"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
|
|
Loading…
Reference in a new issue