Skip to content

Commit 08f4365

Browse files
authored
Use redis cache store instead of memcache (#143)
1 parent 59e6502 commit 08f4365

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

config/environments/production.rb

+16-21
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
params: event.payload[:params].except('controller', 'action', 'format', 'utf8'),
99
user_id: event.payload[:user_id],
1010
organization_id: event.payload[:organization_id],
11-
referer: event.payload[:referer],
11+
referer: event.payload[:referer]
1212
}
1313
end
1414
# Settings specified here will take precedence over those in config/application.rb.
@@ -55,17 +55,13 @@
5555
config.log_level = :info
5656

5757
# Prepend all log lines with the following tags.
58-
config.log_tags = [ :request_id ]
58+
config.log_tags = [:request_id]
5959

6060
# Use a different cache store in production.
61-
if ENV["MEMCACHEDCLOUD_SERVERS"].present?
62-
config.cache_store = :mem_cache_store, ENV["MEMCACHEDCLOUD_SERVERS"].split(","), {
63-
username: ENV["MEMCACHEDCLOUD_USERNAME"], password: ENV["MEMCACHEDCLOUD_PASSWORD"]
64-
}
65-
end
61+
config.cache_store = :redis_cache_store, { url: ENV.fetch('REDIS_STORE_URL', 'redis://localhost:6379') }
6662

6763
# Use a real queuing backend for Active Job (and separate queues per environment)
68-
config.active_job.queue_adapter = :sidekiq
64+
config.active_job.queue_adapter = :sidekiq
6965
# config.active_job.queue_name_prefix = "metadecidim_#{Rails.env}"
7066
config.action_mailer.perform_caching = false
7167

@@ -83,33 +79,32 @@
8379
# Use default logging formatter so that PID and timestamp are not suppressed.
8480
config.log_formatter = ::Logger::Formatter.new
8581
config.action_mailer.smtp_settings = {
86-
:address => Rails.application.secrets.smtp_address,
87-
:port => Rails.application.secrets.smtp_port,
88-
:authentication => Rails.application.secrets.smtp_authentication,
89-
:user_name => Rails.application.secrets.smtp_username,
90-
:password => Rails.application.secrets.smtp_password,
91-
:domain => Rails.application.secrets.smtp_domain,
92-
:enable_starttls_auto => Rails.application.secrets.smtp_starttls_auto,
93-
:openssl_verify_mode => 'none'
82+
address: Rails.application.secrets.smtp_address,
83+
port: Rails.application.secrets.smtp_port,
84+
authentication: Rails.application.secrets.smtp_authentication,
85+
user_name: Rails.application.secrets.smtp_username,
86+
password: Rails.application.secrets.smtp_password,
87+
domain: Rails.application.secrets.smtp_domain,
88+
enable_starttls_auto: Rails.application.secrets.smtp_starttls_auto,
89+
openssl_verify_mode: 'none'
9490
}
9591

9692
if Rails.application.secrets.sendgrid
9793
config.action_mailer.default_options = {
98-
"X-SMTPAPI" => {
99-
filters: {
94+
'X-SMTPAPI' => {
95+
filters: {
10096
clicktrack: { settings: { enable: 0 } },
101-
opentrack: { settings: { enable: 0 } }
97+
opentrack: { settings: { enable: 0 } }
10298
}
10399
}.to_json
104100
}
105101
end
106102

107-
108103
# Use a different logger for distributed setups.
109104
# require 'syslog/logger'
110105
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
111106

112-
if ENV["RAILS_LOG_TO_STDOUT"].present?
107+
if ENV['RAILS_LOG_TO_STDOUT'].present?
113108
logger = ActiveSupport::Logger.new(STDOUT)
114109
logger.formatter = config.log_formatter
115110
config.logger = ActiveSupport::TaggedLogging.new(logger)

0 commit comments

Comments
 (0)