Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Configure Sidekiq and Redis for multiple Ruby on Rails projects

$
0
0

Sidekiq 5.2.5, Redis server 5.0.3, Ruby 2.5.1, Rails 5.2.2

I had one Rails project with configured Redis (redis://localhost:6379/0) and Sidekiq. All is working well.

Now I duplicate project and want it to use Redis and Sidekiq with another database and queues.

What do I need to do to configure it?

I changed Sidekiq initializer config/initializers/sidekiq.rb:

Sidekiq.configure_server do |config|
  config.redis = { url: 'redis://localhost:6379/1' }
end

Sidekiq.configure_client do |config|
  config.redis = { url: 'redis://localhost:6379/1' }
end

But when I start job it put them in Waiting queue. And when I start sidekiq inside of new project it doesn't see redis PID.

Old project:

2020-03-31T21:40:43.607Z 21227 TID-ox61tduif INFO: Running in ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18]
2020-03-31T21:40:43.607Z 21227 TID-ox61tduif INFO: See LICENSE and the LGPL-3.0 for licensing details.
2020-03-31T21:40:43.607Z 21227 TID-ox61tduif INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
2020-03-31T21:40:43.608Z 21227 TID-ox61tduif INFO: Booting Sidekiq 5.2.5 with redis options {:id=>"Sidekiq-server-PID-21227", :url=>nil}

New project:

2020-03-31T21:50:42.970Z 22460 TID-outxczsa8 INFO: Running in ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18]
2020-03-31T21:50:42.970Z 22460 TID-outxczsa8 INFO: See LICENSE and the LGPL-3.0 for licensing details.
2020-03-31T21:50:42.970Z 22460 TID-outxczsa8 INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org
2020-03-31T21:50:42.974Z 22460 TID-outxczsa8 INFO: Starting processing, hit Ctrl-C to stop

Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>