Use Redis as Rails cache store (closes #16)
This commit is contained in:
parent
ff24bc95f4
commit
53a71bb3cc
4 changed files with 25 additions and 2 deletions
|
@ -24,6 +24,11 @@ env:
|
|||
- SIDEKIQ_SERVER_REDIS_DB=0
|
||||
- SIDEKIQ_SERVER_REDIS_PASSWORD=
|
||||
|
||||
- RAILS_CACHE_REDIS_HOST=localhost
|
||||
- RAILS_CACHE_REDIS_PORT=6379
|
||||
- RAILS_CACHE_REDIS_DB=1
|
||||
- RAILS_CACHE_REDIS_PASSWORD=
|
||||
|
||||
before_install:
|
||||
- sudo apt install qt4-qmake libqt4-dev libqtwebkit-dev xvfb
|
||||
|
||||
|
|
12
config/cache_store.yml
Normal file
12
config/cache_store.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
default: &default
|
||||
redis_host: <%= ENV.fetch('RAILS_CACHE_REDIS_HOST') { 'localhost' } %>
|
||||
redis_port: <%= ENV.fetch('RAILS_CACHE_REDIS_PORT') { 6379 } %>
|
||||
redis_db: <%= ENV.fetch('RAILS_CACHE_REDIS_DB') { 1 } %>
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
redis_password: <%= ENV.fetch('RAILS_CACHE_REDIS_PASSWORD') { 'password' } %>
|
||||
|
||||
production:
|
||||
<<: *default
|
||||
redis_password: <%= Rails.application.credentials.rails_cache_redis_password %>
|
|
@ -1 +1 @@
|
|||
gcYwCObZX2xKdhA/weuMzUa98vk5d48HfkxkwCh6Y1apVIOL+G+a0xZiIkmrI62SdRSN5+WnbzF80tth3qkpI6ty5MTXIfsKFL/j9JpST0kQJ62wnQqmmKQrrTPQTvEiGV5+DID8XQ3z0XZdRhn3R23QqsS3HKgJiXvj6pEQVx7JlLk/gcxFmUFRuQUdT42gn2gm1sCqLIwZy0acJZDzvH0/1xvQcgAHzr/9Br4Mdr4oZhYAx/EdWhSH8EduMPUqNDaiHorM2+uzxXAXOqKhqQZvnHxW23bkw3/SPZ+dYhAkq6OucS4tT06T8uJwfJAgw4cxxqq8rlesH7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PFJE52xYBEfirjG1egT9h98i+adb31RCcVBwvkZKvgDdHsmwKAMMYxuJ4F5tTmCjk5uTjH3YXbgWpMZl2cpvH8MYEQ4mPg==--hu3t2F9zShLEv/T1--SrQIA7hc8rTkAK7JNHA3Nw==
|
|
@ -65,7 +65,13 @@ Rails.application.configure do
|
|||
config.log_tags = [:request_id]
|
||||
|
||||
# Use a different cache store in production.
|
||||
# config.cache_store = :mem_cache_store
|
||||
cache_conf = Rails.application.config_for(:cache_store).deep_symbolize_keys
|
||||
config.cache_store = :redis_cache_store, {
|
||||
host: cache_conf[:host],
|
||||
port: cache_conf[:port],
|
||||
db: cache_conf[:db],
|
||||
password: cache_conf[:password],
|
||||
}
|
||||
|
||||
# Use a real queuing backend for Active Job
|
||||
# (and separate queues per environment).
|
||||
|
|
Reference in a new issue