I have a Sidekiq worker functioning well locally, but when deployed to Heroku the jobs get stuck in the queue. I am using Redis-to-go nano and have it up and running, and I have scaled the worker to 1 on Heroku and can see that it is up. I am just using the default queue -- nothing custom or fancy. Here is my code:
config/unicorn.rb:
Sidekiq.configure_client do |config|
config.redis = { size: 1, namespace: 'sidekiq' }
end
config/initializers/redis.rb
uri = URI.parse(ENV["REDISTOGO_URL"] || "redis://localhost:6379")
REDIS = Redis.new(:url => ENV['REDISTOGO_URL'])
Procfile
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
worker: bundle exec sidekiq -c 5 -v -q default
I can see the job in the queue but it is not processing like it does locally. Any advice is much appreciated - thanks!
heroku run console
and run your job synchronouslySomeWorker.new.perform(some_arg)
, it might be throwing an error and get rescheduled. – Ollie