aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2018-02-03 22:55:56 -0500
committerAlec Warner <antarus@gentoo.org>2018-02-03 22:57:09 -0500
commit483cea306928b6b80a3ebaf24ee035d237acf776 (patch)
treec0e09ac9fb44ec35535bca38f1b473328e5be049 /config
parentFix typo in page. (diff)
downloadpackages-483cea306928b6b80a3ebaf24ee035d237acf776.tar.gz
packages-483cea306928b6b80a3ebaf24ee035d237acf776.tar.bz2
packages-483cea306928b6b80a3ebaf24ee035d237acf776.zip
Fix sidekiq initializer.v5.0.5v5.0.4
The previous iteration was incorrect and probably broken. Now two changes are coming: Make redis configurable. It defaults to localhost:default_redis_port but can be specified in REDIS_URL to point somewhere else. We use this in the docker model to point it at a redis container. Fix the initializer, I think it needs to require sidekiq to work such that the logs are squelched.
Diffstat (limited to 'config')
-rw-r--r--config/initializers/sidekiq.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 0c051a5..55ee0f6 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -1,3 +1,13 @@
+require 'sidekiq'
+
+Sidekiq.configure_server do |config|
+ config.redis = { url: ENV.fetch("REDIS_URL", 'localhost:6379' }
+end
+
+Sidekiq.configure_client do |config|
+ config.redis = { url: ENV.fetch("REDIS_URL", 'localhost:6379' }
+end
+
if Rails.env.production?
Sidekiq::Logging.logger.level = Logger::WARN
end