Skip to content

Commit

Permalink
refactor to use REDIS_URL instead of REDIS_CACHE_STORE
Browse files Browse the repository at this point in the history
* pin sidekiq to version
* to retain compatibility with redis 3.x (latest sidekiq requires redis 4.0+)
  • Loading branch information
ryanwoldatwork committed Jan 13, 2020
1 parent b1dd2ff commit 4368e37
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LOGIN_GOV_OPENID_CERT_URL='https://idp.int.identitysandbox.gov/api/openid_connec
NEW_RELIC_KEY=YOUR-NEW-RELIC-KEY-HERE

# Redis cache store
REDIS_CACHE_STORE=redis://localhost:6379/1
REDIS_URL=redis://localhost:6379/1

# For image uploads
S3_AWS_ACCESS_KEY_ID=
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gem 'pg', '>= 0.18', '< 2.0'
gem 'puma'
gem 'rack-cors', require: 'rack/cors'
gem 'sass-rails'
gem 'sidekiq'
gem 'sidekiq', '>= 4.2'
gem 'uglifier'
gem 'json-jwt'
# Use Redis to cache Touchpoints in all envs
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ DEPENDENCIES
rspec_junit_formatter
sass-rails
selenium-webdriver
sidekiq
sidekiq (>= 4.2)
tzinfo-data
uglifier
web-console (>= 3.3.0)
Expand Down
2 changes: 1 addition & 1 deletion config/cable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ test: *redis

production:
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
url: <%= ENV.fetch("REDIS_URL") %>
channel_prefix: touchpoints_production
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
Rails.application.configure do
config.cache_store = :redis_cache_store, { url: ENV["REDIS_CACHE_STORE"] }
config.cache_store = :redis_cache_store, { url: ENV["REDIS_URL"] }
end

# Store uploaded files on the local file system (see config/storage.yml for options)
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
Rails.application.configure do
config.cache_store = :redis_cache_store, { url: ENV["REDIS_CACHE_STORE"] }
config.cache_store = :redis_cache_store, { url: ENV["REDIS_URL"] }
end

# Use a real queuing backend for Active Job (and separate queues per environment)
Expand Down
2 changes: 1 addition & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
Rails.application.configure do
config.cache_store = :redis_cache_store, { url: ENV["REDIS_CACHE_STORE"] }
config.cache_store = :redis_cache_store, { url: ENV["REDIS_URL"] }
end

# Use a real queuing backend for Active Job (and separate queues per environment)
Expand Down
6 changes: 3 additions & 3 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Sidekiq.configure_server do |config|
config.redis = { url: ENV["REDIS_CACHE_STORE"], namespace: "touchpoints_sidekiq_#{Rails.env}" }
config.redis = { url: ENV["REDIS_URL"], namespace: "touchpoints_sidekiq_#{Rails.env}" }
end

Sidekiq.configure_client do |config|
config.redis = { url: ENV["REDIS_CACHE_STORE"], namespace: "touchpoints_sidekiq_#{Rails.env}" }
end
config.redis = { url: ENV["REDIS_URL"], namespace: "touchpoints_sidekiq_#{Rails.env}" }
end

0 comments on commit 4368e37

Please sign in to comment.