Skip to content

Commit

Permalink
Use Memcachier on Heroku.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbothner committed Nov 2, 2016
1 parent f793b3d commit 2037806
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ gem 'jbuilder', '~> 2.0'
gem 'inline_svg'

gem 'redis', '~> 3.0'
gem 'dalli'

gem 'newrelic_rpm'

Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ GEM
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
dalli (2.7.6)
database_cleaner (1.5.3)
debug_inspector (0.0.2)
descendants_tracker (0.0.4)
Expand Down Expand Up @@ -346,6 +347,7 @@ DEPENDENCIES
byebug
capybara
coffee-rails (~> 4.1.0)
dalli
database_cleaner
devise (~> 4.1)
devise-i18n
Expand Down
10 changes: 9 additions & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@
config.log_tags = [ :request_id ]

# Use a different cache store in production.
# config.cache_store = :mem_cache_store
config.cache_store = :dalli_store,
(ENV["MEMCACHIER_SERVERS"] || "").split(","),
{:username => ENV["MEMCACHIER_USERNAME"],
:password => ENV["MEMCACHIER_PASSWORD"],
:failover => true,
:socket_timeout => 1.5,
:socket_failure_delay => 0.2,
:down_retry_delay => 60
}

# Use a real queuing backend for Active Job (and separate queues per environment)
# config.active_job.queue_adapter = :resque
Expand Down

0 comments on commit 2037806

Please sign in to comment.