1

The sidekiq workers get terminated in Heroku very frequently. It should be started every time.

How can we make these workers to run without getting terminated in Heroku?

Do we have any configurations for Sidekiq or Heroku / can we daemonize the Sidekiq and make it to run in Heroku without terminating.

Please help!

Suhas Giriraj
  • 242
  • 2
  • 11
  • how are you running them? do you have a worker instance configured? – phoet Oct 10 '14 at 12:29
  • Yes worker instance is configured and running once the worker is called from the application. The only problem is that Sidekiq gets terminated in Heroku when server goes to idle state. – Suhas Giriraj Oct 10 '14 at 14:09

1 Answers1

1

I have been using this sidekiq with rufus-scheduler for my Herokuapp. Add your scheduler task in rails initializers(#app/config/initializers/task_scheduler.rb) It send daily status at 9am IST.

scheduler = Rufus::Scheduler.new
scheduler.cron '00 09 * * * Asia/Kolkata' do
  puts "it's 9am! good morning!"
  User.daily_status
end

scheduler.every '10s' do
  Rails.logger.info "hello, it's #{Time.now}"
end
Kannan S
  • 2,459
  • 1
  • 17
  • 17