问题
I want to schedule sending mails using Rufus-scheduler in a Rails app deployed on Heroku.
My code looks like
# config/initializers/scheduler.rb
require 'rufus-scheduler'
s = Rufus::Scheduler.singleton
s.every '11h30m' do
# here I put my sending mail task (already tested, and works well)
end
But nothing happened, and I can't figure out the issue based on my logs
I suspected some points:
1- Is my procfile correct ? Do I need something else in order to use Passenger ? will the classic webrick server work ?
web: bundle exec passenger start -p $PORT --max-pool-size 3 --min-instances
2- I do not have a paid worker on Heroku, can I make Rufus-scheduler works with only one free standard web Dyno ?
3- If OK for the 2 questions, do I need to add something else to make the code works ?
Many thanks
来源:https://stackoverflow.com/questions/35651552/rails-using-rufus-in-order-to-schedule-sending-mails-daily